projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Jenkins refresh
[osm/devops.git]
/
installers
/
charm
/
pol-k8s
/
reactive
/
pol_k8s.py
diff --git
a/installers/charm/pol-k8s/reactive/pol_k8s.py
b/installers/charm/pol-k8s/reactive/pol_k8s.py
index
c31a323
..
5d56c27
100644
(file)
--- a/
installers/charm/pol-k8s/reactive/pol_k8s.py
+++ b/
installers/charm/pol-k8s/reactive/pol_k8s.py
@@
-32,12
+32,14
@@
def restart():
@when_not("kafka.ready")
@when_not("kafka.ready")
+@when("leadership.is_leader")
@when_not("pol-k8s.configured")
def waiting_for_kafka():
layer.status.waiting("Waiting for kafka to be ready")
@when_not("mongo.ready")
@when_not("pol-k8s.configured")
def waiting_for_kafka():
layer.status.waiting("Waiting for kafka to be ready")
@when_not("mongo.ready")
+@when("leadership.is_leader")
@when_not("pol-k8s.configured")
def waiting_for_mongo():
layer.status.waiting("Waiting for mongo to be ready")
@when_not("pol-k8s.configured")
def waiting_for_mongo():
layer.status.waiting("Waiting for mongo to be ready")
@@
-69,6
+71,12
@@
def configure():
layer.status.blocked("k8s spec failed to deploy: {}".format(e))
layer.status.blocked("k8s spec failed to deploy: {}".format(e))
+@when("kafka.ready", "mongo.ready")
+@when_not("leadership.is_leader")
+def non_leaders_active():
+ layer.status.active("ready")
+
+
@when("pol-k8s.configured")
def set_pol_active():
layer.status.active("ready")
@when("pol-k8s.configured")
def set_pol_active():
layer.status.active("ready")
@@
-92,7
+100,6
@@
def make_pod_spec(kafka_host, kafka_port, mongo_uri):
cfg = config()
data = {
"name": md.get("name"),
cfg = config()
data = {
"name": md.get("name"),
- "docker_image": cfg.get("image"),
"kafka_host": kafka_host,
"kafka_port": kafka_port,
"mongo_uri": mongo_uri,
"kafka_host": kafka_host,
"kafka_port": kafka_port,
"mongo_uri": mongo_uri,