SUSE / caasp-salt

A collection of salt states used to provision a kubernetes cluster
Apache License 2.0
64 stars 29 forks source link

bsc#1120717: Check all aliases for etcd member check and create /etc/caasp directory before access #730

Closed bergmannf closed 5 years ago

bergmannf commented 5 years ago

This PR adds fixes that were needed to make an update from a v2 to a v3 cluster succeed:

drpaneas commented 5 years ago

Doesn't seem to work

Feb 12 17:34:46 admin salt-minion[2006]: [ERROR   ] Error while bringing up minion for multi-master. Is master at localhost responding?
Feb 12 17:35:20 admin salt-minion[2006]: [ERROR   ] Failed to import module caasp_net, this is due most likely to a syntax error:
Feb 12 17:35:20 admin salt-minion[2006]: Traceback (most recent call last):
Feb 12 17:35:20 admin salt-minion[2006]:   File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1459, in _load_module
Feb 12 17:35:20 admin salt-minion[2006]:     mod = imp.load_module(mod_namespace, fn_, fpath, desc)
Feb 12 17:35:20 admin salt-minion[2006]:   File "/var/cache/salt/minion/extmods/modules/caasp_net.py", line 47
Feb 12 17:35:20 admin salt-minion[2006]:     return found_aliases
Feb 12 17:35:20 admin salt-minion[2006]:          ^
Feb 12 17:35:20 admin salt-minion[2006]: SyntaxError: invalid syntax
Feb 12 17:35:23 admin salt-minion[2006]: [ERROR   ] State 'caasp_hosts.managed' was not found in SLS 'etc-hosts'
Feb 12 17:35:23 admin salt-minion[2006]: Reason: 'caasp_hosts.managed' is not available.
Feb 12 17:35:45 admin salt-minion[2006]: [ERROR   ] Failed to import module caasp_net, this is due most likely to a syntax error:
Feb 12 17:35:45 admin salt-minion[2006]: Traceback (most recent call last):
Feb 12 17:35:45 admin salt-minion[2006]:   File "/usr/lib/python2.7/site-packages/salt/loader.py", line 1459, in _load_module
Feb 12 17:35:45 admin salt-minion[2006]:     mod = imp.load_module(mod_namespace, fn_, fpath, desc)
Feb 12 17:35:45 admin salt-minion[2006]:   File "/var/cache/salt/minion/extmods/modules/caasp_net.py", line 47
Feb 12 17:35:45 admin salt-minion[2006]:     return found_aliases
Feb 12 17:35:45 admin salt-minion[2006]:          ^
Feb 12 17:35:45 admin salt-minion[2006]: SyntaxError: invalid syntax
Feb 12 17:35:47 admin salt-minion[2006]: [ERROR   ] State 'caasp_hosts.managed' was not found in SLS 'etc-hosts'
Feb 12 17:35:47 admin salt-minion[2006]: Reason: 'caasp_hosts.managed' is not available.
Feb 12 17:37:10 admin salt-minion[2006]: [ERROR   ] Rendering exception occurred
Feb 12 17:37:10 admin salt-minion[2006]: Traceback (most recent call last):
Feb 12 17:37:10 admin salt-minion[2006]:   File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 170, in render_tmpl
Feb 12 17:37:10 admin salt-minion[2006]:     output = render_str(tmplstr, context, tmplpath)
Feb 12 17:37:10 admin salt-minion[2006]:   File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 391, in render_jinja_tmpl
Feb 12 17:37:10 admin salt-minion[2006]:     buf=tmplstr)
Feb 12 17:37:10 admin salt-minion[2006]: SaltRenderError: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'caasp_nodes'
Feb 12 17:37:10 admin salt-minion[2006]: [ERROR   ] Unable to render top file: Jinja variable 'salt.utils.templates.AliasedLoader object' has no attribute 'caasp_nodes'
Feb 12 17:40:33 admin salt-minion[2006]: [WARNING ] /usr/lib/python2.7/site-packages/salt/modules/mine.py:296: DeprecationWarning: the target type should be passed using the 'tgt_type' argument instead of 'expr_form'. Support for using 'expr_form' will be removed in Salt Fluorine.
Feb 12 17:40:35 admin salt-minion[2006]: [ERROR   ] /etc/hosts was not generated successfully: _makedirs() got an unexpected keyword argument 'exist_ok'
mjura commented 5 years ago

@bergmannf It has to be rebased

MalloZup commented 5 years ago

@bergmannf the master branch here should be caasp V4, which AFAIK doesn't support migration from to 2 to 3 and other combinations, so IMHO should be only a 30 branch(not head) pr. Or I am missing something? Tia

bergmannf commented 5 years ago

@MalloZup I detected this during the updates from v2 -> v3, but the changes in the codes should also make the code more robust in the v4 release (especially using all the aliases is something that should go into v4 as well).

MalloZup commented 5 years ago

@bergmannf backport to 30 if needed thx. before merging it, put the bug number in the commit msg

MalloZup commented 5 years ago

the PR/CI is failing on update. it is a known race condition on our salt states Product. retriggering

bergmannf commented 5 years ago

@MalloZup CI finally passed :+1:

MalloZup commented 5 years ago

@bergmannf to me is good to merge. Unless somebody have some things against it. @inercia cc