Skip to content

Commit

Permalink
salt: Ensure we do not have multi cidr for Control Plane with MetalLB
Browse files Browse the repository at this point in the history
Today we do not support multiple subnet for Control Plane network when
MetalLB is enabled, so this commit check that it's not the case

See: #3502
  • Loading branch information
TeddyAndrieux committed Sep 14, 2021
1 parent 28e1fe8 commit 7eef67e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
- Fix UI issues in multi nodes environment when a node
is unavailable (PR[#3521](https://github.com/scality/metalk8s/pull/3521))

## Bug fixes

- Manage Control Plane Ingress Virtual IP with MetalLB is not
supported when you have multiple subnet in Control Plane
network, now it's properly checked
(PR [#](https://github.com/scality/metalk8s/pull/))

## Release 2.10.2
### Bug fixes
- Fix the link to documentation from the UI navigation bar
Expand Down
20 changes: 13 additions & 7 deletions salt/_pillar/metalk8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ def _load_networks(config_data):
# MetalLB disabled by default
networks_data["controlPlane"].setdefault("metalLB", {}).setdefault("enabled", False)

if networks_data["controlPlane"]["metalLB"]["enabled"] and not networks_data[
"controlPlane"
].get("ingress", {}).get("ip"):
errors.append(
"'ip' for 'ingress' in 'controlPlane' network is mandatory when 'metalLB'"
"is enabled"
)
if networks_data["controlPlane"]["metalLB"]["enabled"]:
if not networks_data["controlPlane"].get("ingress", {}).get("ip"):
errors.append(
"'ip' for 'ingress' in 'controlPlane' network is mandatory when "
"'metalLB' is enabled"
)
if len(networks_data["controlPlane"]["cidr"]) > 1:
errors.append(
"Control Plane Ingress Virtual IP management with MetalLB is "
"currently not supported when you have multiple subnet for "
"Control Plane network, see "
"https://github.com/scality/metalk8s/issues/3502"
)

if errors:
return __utils__["pillar_utils.errors_to_dict"](errors)
Expand Down

0 comments on commit 7eef67e

Please sign in to comment.