]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: make group parameter optional for nvmeof (squid) 67623/head
authorKefu Chai <k.chai@proxmox.com>
Tue, 3 Mar 2026 04:51:32 +0000 (12:51 +0800)
committerKefu Chai <k.chai@proxmox.com>
Mon, 9 Mar 2026 12:21:29 +0000 (20:21 +0800)
Add default value for group parameter in nvmeof commands to maintain
backward compatibility with existing squid tests and deployments.

Context:
--------
On main branch, when commit 6bee4e10f7f added the group parameter, the
tests were subsequently updated to provide the group argument explicitly:

  Main test: ceph orch apply nvmeof foo default
  Expected: nvmeof.foo.default

However, on squid branch, the existing tests still use the older syntax
without specifying a group:

  Squid test: ceph orch apply nvmeof foo
  Expected: nvmeof.foo

The previous cherry-pick (e1612d048a1) fixed the service_id construction
logic to handle empty groups correctly, but the group parameter was still
required without a default value, causing "ceph orch apply nvmeof foo" to
fail with EINVAL (missing required argument).

This commit adds the missing default value (group: str = '') to make the
parameter optional, maintaining backward compatibility with existing squid
tests and user scripts that don't specify a group.

With both changes:
1. Cherry-picked e1612d048a1: service_id logic handles empty group
2. This commit: group parameter has default value ''

Result:
  "ceph orch apply nvmeof foo" works (creates nvmeof.foo)
  "ceph orch apply nvmeof foo mygroup" also works (creates nvmeof.foo.mygroup)

Test: qa/suites/orch/cephadm/smoke-roleless/2-services/nvmeof.yaml
Fixes job 50373 failure from test run dgalloway-2026-02-13_23:06:25

Please note, this change was not cherry-picked from main branch, because
main intentionally still requires the CLI group argument for arch
apply/add nvmeof, and its tests were updated accordingly.
On squid, however, the earlier cherry-pick 6bee4e10 introduced the
required group parameter, but squid still has the old test/behavior
(ceph orch apply nvmeof foo expecting nvmeof.foo) and does not contain
the later main commits 3e5e85aadc1 and b377085c302.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
src/pybind/mgr/orchestrator/module.py

index c38b57ae52398e767cb6327abbffe16f3d795abf..df1fe1bf720877df0926a3cadaf7514de23712b9 100644 (file)
@@ -1566,7 +1566,7 @@ Usage:
     @_cli_write_command('orch daemon add nvmeof')
     def _nvmeof_add(self,
                     pool: str,
-                    group: str,
+                    group: str = '',
                     placement: Optional[str] = None,
                     inbuf: Optional[str] = None) -> HandleCommandResult:
         """Start nvmeof daemon(s)"""
@@ -1880,7 +1880,7 @@ Usage:
     @_cli_write_command('orch apply nvmeof')
     def _apply_nvmeof(self,
                       pool: str,
-                      group: str,
+                      group: str = '',
                       placement: Optional[str] = None,
                       unmanaged: bool = False,
                       dry_run: bool = False,