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 CSR approving issue for existing nodes with already approved and GCed CSRs #1894

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

kron4eg
Copy link
Member

@kron4eg kron4eg commented Mar 17, 2022

What type of PR is this?
/kind bug

What this PR does / why we need it:
Successfully approved CSR is GC-ed after 1 hour, effectively leading to the situation where perfectly good Kubelet cert doesn't need any new CSRs will make kubeone to throw out with misleading error.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1893

Does this PR introduce a user-facing change?:

Fix CSR approving issue for existing nodes with already approved and GCed CSRs

Signed-off-by: Artiom Diomin <kron82@gmail.com>
@kubermatic-bot kubermatic-bot added kind/bug Categorizes issue or PR as related to a bug. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 17, 2022
@kron4eg
Copy link
Member Author

kron4eg commented Mar 17, 2022

/cherrypick release/v1.4

@kubermatic-bot
Copy link
Contributor

@kron4eg: once the present PR merges, I will cherry-pick it on top of release/v1.4 in a new PR and assign it to you.

In response to this:

/cherrypick release/v1.4

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.

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f8f96293e1f1a3080cc725ec4892778a41b64087

@kron4eg
Copy link
Member Author

kron4eg commented Mar 17, 2022

/hold

@kubermatic-bot kubermatic-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2022
@@ -244,7 +243,11 @@ func approvePendingCSR(s *state.State, node *kubeoneapi.HostConfig, conn ssh.Con
}
}

return approveErr
if !csrFound {
s.Logger.Info("no CSR found for node %q, assuming it was garbage-collected", node.Hostname)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: uppercase log messages.

Suggested change
s.Logger.Info("no CSR found for node %q, assuming it was garbage-collected", node.Hostname)
s.Logger.Info("No CSR found for node %q, assuming it was garbage-collected", node.Hostname)

Signed-off-by: Artiom Diomin <kron82@gmail.com>
@kubermatic-bot kubermatic-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
Copy link
Member

@xmudrii xmudrii 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

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kron4eg, xmudrii

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

@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4579b78ee4c872329cbc8bdd89cb17cad0974962

@kron4eg
Copy link
Member Author

kron4eg commented Mar 17, 2022

/unhold

@kubermatic-bot kubermatic-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2022
@kubermatic-bot kubermatic-bot merged commit 3e41894 into kubermatic:master Mar 17, 2022
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.5 milestone Mar 17, 2022
@kubermatic-bot
Copy link
Contributor

@kron4eg: new pull request created: #1897

In response to this:

/cherrypick release/v1.4

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.

@kron4eg kron4eg deleted the 1893-csr-approve branch March 18, 2022 08:40
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. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to add another static worker to an existing cluster fails.
4 participants