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 panic with SIGSEGV in kubeadm certs check-expiration #124124

Merged
merged 1 commit into from Apr 1, 2024

Conversation

carlory
Copy link
Member

@carlory carlory commented Apr 1, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #124120

Special notes for your reviewer:

Does this PR introduce a user-facing change?

kubeadm: fix panic in the command "kubeadm certs check-expiration" when "/etc/kubernetes/pki" exists but cannot be read.

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


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 1, 2024
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.30 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.30.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Apr 1 02:16:24 UTC 2024.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 1, 2024
@neolit123
Copy link
Member

/release-note-edit

kubeadm: fix panic in the command "kubeadm certs check-expiration" when "/etc/kubernetes/pki" exists but cannot be read.

Copy link
Member

@neolit123 neolit123 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
/triage accepted
/priority important-longterm

thanks for the quick fix.

@@ -239,7 +239,7 @@ func TestFileExists(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := fileExists(tt.filename); got != tt.want {
if got, _ := fileExists(tt.filename); got != tt.want {
Copy link
Member

Choose a reason for hiding this comment

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

after this change there is a missing unit test case for the return false, err return of func fileExists(filename string) (bool, error) { but i don't insist of adding it.

we could use os.Chmod() or a os.WriteFile with a restrictive FileMode, but then this test will not work on Windows, i think.

so fine to leave this test case out for now.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Apr 1, 2024
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 1, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a6f2b568db7b1be7389698ca8d2b3982a7c05ef2

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carlory, neolit123

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 Apr 1, 2024
@neolit123
Copy link
Member

let's see if this can be added in 1.30.0

/milestone v1.30

@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Apr 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit 79c61d5 into kubernetes:master Apr 1, 2024
14 checks passed
@neolit123
Copy link
Member

please send backport PRs for 1.29, 1.28, 1.27

https://kubernetes.io/releases/

k8s-ci-robot added a commit that referenced this pull request Apr 5, 2024
…124-upstream-release-1.27

Automated cherry pick of #124124: fix panic with SIGSEGV in kubeadm certs check-expiration
k8s-ci-robot added a commit that referenced this pull request Apr 5, 2024
…124-upstream-release-1.29

Automated cherry pick of #124124: fix panic with SIGSEGV in kubeadm certs check-expiration
k8s-ci-robot added a commit that referenced this pull request Apr 5, 2024
…124-upstream-release-1.28

Automated cherry pick of #124124: fix panic with SIGSEGV in kubeadm certs check-expiration
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/kubeadm 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. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic with SIGSEGV in kubeadm certs check-expiration
3 participants