mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
lint fixes for goal state checks
This commit is contained in:
parent
759f3e21da
commit
428a63e9a1
@ -402,7 +402,7 @@ def set_final_status():
|
|||||||
goal_state = {}
|
goal_state = {}
|
||||||
|
|
||||||
if not is_state('kube-api-endpoint.available'):
|
if not is_state('kube-api-endpoint.available'):
|
||||||
if 'relations' in goal_state and 'kube-api-endpoint' in goal_state['relations']:
|
if 'kube-api-endpoint' in goal_state.get('relations', {}):
|
||||||
status = 'waiting'
|
status = 'waiting'
|
||||||
else:
|
else:
|
||||||
status = 'blocked'
|
status = 'blocked'
|
||||||
@ -410,7 +410,7 @@ def set_final_status():
|
|||||||
return
|
return
|
||||||
|
|
||||||
if not is_state('kube-control.connected'):
|
if not is_state('kube-control.connected'):
|
||||||
if 'relations' in goal_state and 'kube-control' in goal_state['relations']:
|
if 'kube-control' in goal_state.get('relations', {}):
|
||||||
status = 'waiting'
|
status = 'waiting'
|
||||||
else:
|
else:
|
||||||
status = 'blocked'
|
status = 'blocked'
|
||||||
|
@ -403,8 +403,8 @@ def sdn_changed():
|
|||||||
@when('kubernetes-worker.config.created')
|
@when('kubernetes-worker.config.created')
|
||||||
@when_not('kubernetes-worker.ingress.available')
|
@when_not('kubernetes-worker.ingress.available')
|
||||||
def render_and_launch_ingress():
|
def render_and_launch_ingress():
|
||||||
''' If configuration has ingress daemon set enabled, launch the ingress load
|
''' If configuration has ingress daemon set enabled, launch the ingress
|
||||||
balancer and default http backend. Otherwise attempt deletion. '''
|
load balancer and default http backend. Otherwise attempt deletion. '''
|
||||||
config = hookenv.config()
|
config = hookenv.config()
|
||||||
# If ingress is enabled, launch the ingress controller
|
# If ingress is enabled, launch the ingress controller
|
||||||
if config.get('ingress'):
|
if config.get('ingress'):
|
||||||
@ -1016,7 +1016,7 @@ def missing_kube_control():
|
|||||||
except NotImplementedError:
|
except NotImplementedError:
|
||||||
goal_state = {}
|
goal_state = {}
|
||||||
|
|
||||||
if 'relations' in goal_state and 'kube-control' in goal_state['relations']:
|
if 'kube-control' in goal_state.get('relations', {}):
|
||||||
hookenv.status_set(
|
hookenv.status_set(
|
||||||
'waiting',
|
'waiting',
|
||||||
'Waiting for kubernetes-master to become ready')
|
'Waiting for kubernetes-master to become ready')
|
||||||
|
Loading…
Reference in New Issue
Block a user