Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
dce7a87d
Commit
dce7a87d
authored
Nov 03, 2017
by
Konstantinos Tsakalozos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removing flush_auth_for_departed
parent
b134ce76
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
29 deletions
+0
-29
kubernetes_master.py
...ju/layers/kubernetes-master/reactive/kubernetes_master.py
+0
-29
No files found.
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
View file @
dce7a87d
...
@@ -472,35 +472,6 @@ def create_service_configs(kube_control):
...
@@ -472,35 +472,6 @@ def create_service_configs(kube_control):
remove_state
(
'authentication.setup'
)
remove_state
(
'authentication.setup'
)
@when
(
'kube-control.departed'
)
@when
(
'leadership.is_leader'
)
def
flush_auth_for_departed
(
kube_control
):
''' Unit has left the cluster and needs to have its authentication
tokens removed from the token registry '''
token_auth_file
=
'/root/cdk/known_tokens.csv'
departing_units
=
kube_control
.
flush_departed
()
if
departing_units
:
userids
=
[]
for
departing_unit
in
departing_units
:
userids
.
append
(
"kubelet-{}"
.
format
(
departing_unit
.
split
(
'/'
)[
1
]))
known_tokens
=
open
(
token_auth_file
,
'r'
)
.
readlines
()
for
line
in
known_tokens
[:]:
haystack
=
line
.
split
(
','
)
# skip the entry if we dont have token,user,id,groups format
if
len
(
haystack
)
<
4
:
continue
if
haystack
[
2
]
in
userids
:
hookenv
.
log
(
'Found unit {} in token auth. Removing auth'
' token.'
.
format
(
haystack
[
2
]))
known_tokens
.
remove
(
line
)
# atomically rewrite the file minus any scrubbed units
hookenv
.
log
(
'Rewriting token auth file: {}'
.
format
(
token_auth_file
))
with
open
(
token_auth_file
,
'w'
)
as
fp
:
fp
.
writelines
(
known_tokens
)
# Trigger rebroadcast of auth files for followers
remove_state
(
'authentication.setup'
)
@when_not
(
'kube-control.connected'
)
@when_not
(
'kube-control.connected'
)
def
missing_kube_control
():
def
missing_kube_control
():
"""Inform the operator master is waiting for a relation to workers.
"""Inform the operator master is waiting for a relation to workers.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment