Skip to content

Commit

Permalink
CASMCMS-8451: Fail sessions that specify nodes that are not in the te…
Browse files Browse the repository at this point in the history
…nant
  • Loading branch information
Ryan Bak committed Oct 27, 2023
1 parent ac026ea commit 48a2b7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Changed
- Sessions the specify nodes that aren't in the current tenant will fail

## [2.10.0] - 10-18-2023
### Fixed
Expand Down
7 changes: 7 additions & 0 deletions src/bos/operators/session_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ def _get_boot_set_component_list(self, boot_set) -> Set[str]:
# Populate from nodelist
for node_name in boot_set.get('node_list', []):
nodes.add(node_name)
if nodes:
tenant_nodes = self._apply_tenant_limit(nodes)
if nodes != tenant_nodes:
invalid_nodes = ",".join(list(nodes.difference(tenant_nodes)))
raise SessionSetupException(
f"The session template includes nodes which do not exist"
f" or are not available to this tenant: {invalid_nodes}")
# Populate from node_groups
for group_name in boot_set.get('node_groups', []):
if group_name not in self.inventory.groups:
Expand Down

0 comments on commit 48a2b7d

Please sign in to comment.