Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Laperche <[email protected]>
  • Loading branch information
slaperche-scality committed Aug 19, 2019
1 parent c1aea5e commit 42410e6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions salt/_states/metalk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def static_pod_managed(name,
)


def module_run(name, attemps=1, sleep_time=10, **kwargs):
def module_run(name, attemps=1, sleep_time=10, until=True, **kwargs):
"""Classic module.run with a retry logic as it's buggy in salt version
https://github.com/saltstack/salt/issues/44639
"""
Expand All @@ -90,7 +90,7 @@ def module_run(name, attemps=1, sleep_time=10, **kwargs):
ret['comment'] = str(exc)

retry = retry - 1
if retry and not ret['result']:
if retry and ret['result'] != until:
time.sleep(sleep_time)

return ret
1 change: 1 addition & 0 deletions salt/metalk8s/orchestrate/etcd.sls
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Check etcd cluster health for {{ node }}:
- metalk8s_etcd.check_etcd_health:
- minion_id: {{ node }}
- attemps: 5
- until: "cluster is healthy"
- require:
- salt: Deploy etcd {{ node }} to {{ dest_version }}

Expand Down
8 changes: 8 additions & 0 deletions salt/metalk8s/salt/minion/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ Ensure salt-minion running:
- test.ping: []
- require:
- service: Ensure salt-minion running

Ensure startup state finished:
metalk8s.module_run:
- state.running: []
- attempts: 5
- until: []
- require:
- module: Ensure salt-minion running
4 changes: 2 additions & 2 deletions scripts/bootstrap.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ configure_salt_minion_local_mode() {
local -r file_root="$base_dir/salt"

"$SALT_CALL" --file-root="$file_root" \
--local --retcode-passthrough saltutil.sync_all
--local --retcode-passthrough saltutil.sync_all saltenv=base
"$SALT_CALL" --file-root="$file_root" \
--local --retcode-passthrough state.sls metalk8s.salt.minion.local \
pillar="{'metalk8s': {'products': '$base_dir'}}"
pillar="{'metalk8s': {'products': '$base_dir'}}" saltenv=base
}

get_salt_container() {
Expand Down

0 comments on commit 42410e6

Please sign in to comment.