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
ace790c0
Commit
ace790c0
authored
Jun 18, 2018
by
Kevin W Monroe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set more accurate status based on charm goal_state
parent
6d3f5b75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
6 deletions
+29
-6
kubernetes_master.py
...ju/layers/kubernetes-master/reactive/kubernetes_master.py
+15
-2
kubernetes_worker.py
...ju/layers/kubernetes-worker/reactive/kubernetes_worker.py
+14
-4
No files found.
cluster/juju/layers/kubernetes-master/reactive/kubernetes_master.py
View file @
ace790c0
...
...
@@ -396,12 +396,25 @@ def set_app_version():
@hookenv.atexit
def
set_final_status
():
''' Set the final status of the charm as we leave hook execution '''
try
:
goal_state
=
hookenv
.
goal_state
()
except
NotImplementedError
:
goal_state
=
{}
if
not
is_state
(
'kube-api-endpoint.available'
):
hookenv
.
status_set
(
'blocked'
,
'Waiting for kube-api-endpoint relation'
)
if
'relations'
in
goal_state
and
'kube-api-endpoint'
in
goal_state
[
'relations'
]:
status
=
'waiting'
else
:
status
=
'blocked'
hookenv
.
status_set
(
status
,
'Waiting for kube-api-endpoint relation'
)
return
if
not
is_state
(
'kube-control.connected'
):
hookenv
.
status_set
(
'blocked'
,
'Waiting for workers.'
)
if
'relations'
in
goal_state
and
'kube-control'
in
goal_state
[
'relations'
]:
status
=
'waiting'
else
:
status
=
'blocked'
hookenv
.
status_set
(
status
,
'Waiting for workers.'
)
return
upgrade_needed
=
is_state
(
'kubernetes-master.upgrade-needed'
)
...
...
cluster/juju/layers/kubernetes-worker/reactive/kubernetes_worker.py
View file @
ace790c0
...
...
@@ -1008,10 +1008,20 @@ def missing_kube_control():
missing.
"""
hookenv
.
status_set
(
'blocked'
,
'Relate {}:kube-control kubernetes-master:kube-control'
.
format
(
hookenv
.
service_name
()))
try
:
goal_state
=
hookenv
.
goal_state
()
except
NotImplementedError
:
goal_state
=
{}
if
'relations'
in
goal_state
and
'kube-control'
in
goal_state
[
'relations'
]:
hookenv
.
status_set
(
'waiting'
,
'Waiting for kubernetes-master to become ready'
)
else
:
hookenv
.
status_set
(
'blocked'
,
'Relate {}:kube-control kubernetes-master:kube-control'
.
format
(
hookenv
.
service_name
()))
@when
(
'docker.ready'
)
...
...
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