Skip to content

Commit

Permalink
ARTESCA-10079 force bootstrap bundle roles on ext pillar
Browse files Browse the repository at this point in the history
  • Loading branch information
aprucolimartins committed Nov 13, 2023
1 parent 8d43624 commit f861bc8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions salt/_pillar/metalk8s_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ def node_info(node, ca_minion, pillar):
# The `is_bootstrap` flag is set in pillar only when run the
# `metalk8s.orchestrate.bootstrap` state.
if not roles and pillar.get("is_bootstrap", False):
log.debug(
"Workaround: Adding bootstrap roles to pillar for node %s",
node["metadata"]["name"],
)
roles.add("bootstrap")
roles.add("master")
roles.add("etcd")
if "metalk8s" in pillar:
if "nodes" in pillar["metalk8s"]:
if ca_minion in pillar["metalk8s"]["nodes"]:
for role in pillar["metalk8s"]["nodes"][ca_minion].get("roles", []):
log.debug(
"Workaround: Adding role '%s' to pillar in node '%s'",
role,
node["metadata"]["name"],
)
roles.add(role)
# End of workaround

if node["metadata"]["name"] == ca_minion:
Expand Down

0 comments on commit f861bc8

Please sign in to comment.