Skip to content

smb: fix custom ports feature with remote-control sidecar#65069

Merged
adk3798 merged 4 commits intoceph:mainfrom
phlogistonjohn:jjm-fix-ports-remotectl
Aug 20, 2025
Merged

smb: fix custom ports feature with remote-control sidecar#65069
adk3798 merged 4 commits intoceph:mainfrom
phlogistonjohn:jjm-fix-ports-remotectl

Conversation

@phlogistonjohn
Copy link
Contributor

Fixes a mistake in 09da84f when we added a new service/port for the remote-control and fixes a mistake in 4180cdd where the port name is based on lowercasing the enum name (as that value will have an underscore instead of dash as generated by the mgr).

Take the opportunity to use common constants for some of these smb related things by creating a new directory under python-common/ceph, specifically so these common things can be used by the mgr code, cephadm code, and/or other parts of python-common.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

Add a new smb sub package for smb related things that are meant to
be shared throughout the Ceph python code related to smb and the
smb management stack.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Update the SMBSpec class to use the new constants provided by the
recently added python-common smb package.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
self.CTDB: ceph.smb.constants.CTDB,
self.REMOTE_CONTROL: ceph.smb.constants.REMOTE_CONTROL
}
return names[self]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mypy complaint from make check (check-black was also failing)

cephadmlib/daemons/smb.py: note: In member "__str__" of class "Ports":
cephadmlib/daemons/smb.py:130: error: Invalid index type "Ports" for "dict[int, str]"; expected type "int"  [index]
Found 1 error in 1 file (checked 49 source files)
mypy: exit 1 (13.13 seconds) /home/jenkins-build/build/workspace/ceph-pull-requests/src/cephadm> mypy --config-file ../mypy.ini cephadm.py cephadmlib pid=775889
mypy: FAIL ✖ in 33.01 seconds

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a weird one (see coment). But I worked around it.

Copy link
Contributor

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

See below for minor nit.

Make behavior consistent across the smb mgr module and the service spec
class by using the same set of constants.
Fix an issue supporting the customization of the `remote-control`
sidecar's port.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Use the new set of constants to ensure all components that touch the smb
services use the same set of ports and port names.  Ensure that the
remote-control sidecar service's port can be customized.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
@phlogistonjohn phlogistonjohn force-pushed the jjm-fix-ports-remotectl branch from 3c5e860 to 98d4853 Compare August 16, 2025 20:43
@adk3798
Copy link
Contributor

adk3798 commented Aug 17, 2025

jenkins test make check

1 similar comment
@anoopcs9
Copy link
Contributor

jenkins test make check

Copy link
Contributor

@avanthakkar avanthakkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@adk3798
Copy link
Contributor

adk3798 commented Aug 19, 2025

jenkins test make check

1 similar comment
@phlogistonjohn
Copy link
Contributor Author

jenkins test make check

@adk3798 adk3798 merged commit 5ed3a98 into ceph:main Aug 20, 2025
13 of 14 checks passed
@phlogistonjohn phlogistonjohn deleted the jjm-fix-ports-remotectl branch August 27, 2025 14:27
@phlogistonjohn phlogistonjohn added the wip-spuiuk-tracking Sachin Prabhu - tracking label Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants