Skip to content

Commit f6d552d

Browse files
committed
mgr/orchestrator: require "group" field for nvmeof specs
Signed-off-by: Adam King <[email protected]>
1 parent 8017ef5 commit f6d552d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/pybind/mgr/orchestrator/module.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,6 +1831,7 @@ def _apply_mgmt_gateway(self,
18311831
@_cli_write_command('orch apply nvmeof')
18321832
def _apply_nvmeof(self,
18331833
pool: str,
1834+
group: str,
18341835
placement: Optional[str] = None,
18351836
unmanaged: bool = False,
18361837
dry_run: bool = False,
@@ -1842,8 +1843,9 @@ def _apply_nvmeof(self,
18421843
raise OrchestratorValidationError('unrecognized command -i; -h or --help for usage')
18431844

18441845
spec = NvmeofServiceSpec(
1845-
service_id=pool,
1846+
service_id=f'{pool}.{group}',
18461847
pool=pool,
1848+
group=group,
18471849
placement=PlacementSpec.from_string(placement),
18481850
unmanaged=unmanaged,
18491851
preview_only=dry_run

src/python-common/ceph/deployment/service_spec.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,7 @@ def __init__(self,
13811381
#: ``name`` name of the nvmeof gateway
13821382
self.name = name
13831383
#: ``group`` name of the nvmeof gateway
1384-
self.group = group or ''
1384+
self.group = group
13851385
#: ``enable_auth`` enables user authentication on nvmeof gateway
13861386
self.enable_auth = enable_auth
13871387
#: ``state_update_notify`` enables automatic update from OMAP in nvmeof gateway
@@ -1473,6 +1473,9 @@ def validate(self) -> None:
14731473
if not self.pool:
14741474
raise SpecValidationError('Cannot add NVMEOF: No Pool specified')
14751475

1476+
if not self.group:
1477+
raise SpecValidationError('Cannot add NVMEOF: No group specified')
1478+
14761479
if self.enable_auth:
14771480
if not all([self.server_key, self.server_cert, self.client_key,
14781481
self.client_cert, self.root_ca_cert]):

0 commit comments

Comments
 (0)