-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Fixes juju kubernetes master: 1. Get certs from a dead leader. 2. Append tokens. #43620
Fixes juju kubernetes master: 1. Get certs from a dead leader. 2. Append tokens. #43620
Conversation
Hi @ktsakalozos. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with 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. I understand the commands that are listed here. |
set_state('authentication.setup') | ||
|
||
|
||
def get_keys_from_leader(keys): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstrings for every method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
hookenv.status_set('maintenance', 'Rendering authentication templates.') | ||
|
||
# Set an array for looping logic | ||
keys = [service_key, basic_auth, known_tokens] | ||
for k in keys: | ||
# If the path does not exist, assume we need it | ||
if not os.path.exists(k): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the path doesn't exist and the contents are none this new method returns. Previously that same code exited the original setup_non_leader_authentication
method which prevented the "authentication.setup" state from being set. Is this different behavior intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. In the latest commit get_keys_from_leader returns False if any of the keys were not fetched
/approve |
Thanks for changing the code @ktsakalozos! /approve |
@k8s-bot ok to test |
Can you please add release notes for this? Thanks. |
I've addressed conflicts and updated the release note. Thanks |
/lgtm |
/assign @marcoceppi |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ktsakalozos, marcoceppi, mbruzek, mikedanese
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 41530, 44814, 43620, 41985) |
Automatic merge from submit-queue (batch tested with PRs 41530, 44814, 43620, 41985) Fixes juju kubernetes master: 1. Get certs from a dead leader. 2. Append tokens. **What this PR does / why we need it**: Fixes two issues with the Juju kubernetes master. 1. Grab certificates from a leader that is already removed. 2. Append (not truncate) auth tokens **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # fixes kubernetes#43563 fixes kubernetes#43519 **Special notes for your reviewer**: **Release note**: ``` Recover certificates from leadership context in case all masters die in a Juju deployment ```
What this PR does / why we need it:
Fixes two issues with the Juju kubernetes master.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #fixes #43563 fixes #43519
Special notes for your reviewer:
Release note: