USHIFT-667: Avoid regenerating keypair for Service Account tokens#1200
USHIFT-667: Avoid regenerating keypair for Service Account tokens#1200openshift-merge-robot merged 1 commit intoopenshift:mainfrom
Conversation
Signed-off-by: Ricardo Noriega <rnoriega@redhat.com>
|
/hold |
|
@oglok can you explain how the issue happens and how the PR fixes it? :) |
I've edited the PR description. |
|
/unhold PR is fully tested and after restart, the keypair for service account tokens is fully authorized. No more errors like: |
| ) | ||
|
|
||
| func EnsureKeyPair(pubKeyPath, privKeyPath string) error { | ||
| if _, err := getKeyPair(pubKeyPath, privKeyPath); err == nil { |
There was a problem hiding this comment.
Should we have a log if the error is not nil? Is it relevant enough even though its regenerated afterwards?
There was a problem hiding this comment.
If getKeyPair is not successful, it will return all errors internally. I'd say it's not necessary.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: oglok, pacevedom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@oglok: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
Signed-off-by: Ricardo Noriega rnoriega@redhat.com
Which issue(s) this PR addresses:
The issue happens when MicroShift is restarted, and the keypair used to verify service account tokens is regenerated. At first boot, KAS and KCM will read the content of the initial file and keep that information internally. After restart, the user agents calling the API server with the private key will be unauthorized because it has changed.
This PR prevents the regeneration of the key pair.
Closes USHIFT-667