Skip to content

mgr/cephadm: add config section to ServiceSpec - #39648

Merged
sebastian-philipp merged 3 commits into
ceph:masterfrom
liewegas:cephadm-spec-config
Feb 26, 2021
Merged

sebastian-philipp merged 3 commits into
ceph:masterfrom
liewegas:cephadm-spec-config

Conversation

@liewegas

Copy link
Copy Markdown
Member

Pass config key/value pairs through and set them in teh appropriate section.
Disallow options that are managed by cephadm itself.

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

@liewegas
liewegas requested a review from a team as a code owner February 23, 2021 18:56
Comment thread src/pybind/mgr/cephadm/serve.py Outdated
Comment on lines 457 to 467

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

raise and make it a HEALTH warning? I don't like silent fails, as they make it super hard to debug stuff. Like "why is this config option not working at all?"

Also, would be great to validate them in the cli handler synchronously

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

very tedious to raise a health warning from here, but i added validation at apply time, so this would only happen if a spec had a config option that was removed from ceph (and i think that's pretty harmless)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sebastian-philipp

Copy link
Copy Markdown
Contributor

@sebastian-philipp sebastian-philipp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm! (except for the missing events)

Comment thread src/pybind/mgr/cephadm/serve.py Outdated
Comment on lines 470 to 480

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

also

self.mgr.events.for_service(spec, 'ERROR', msg)

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

If a service is managing a config option, prevent the user from specifying
it in the spec.

Signed-off-by: Sage Weil <[email protected]>
Make sure config options are valid/exist.

Signed-off-by: Sage Weil <[email protected]>
@sebastian-philipp

Copy link
Copy Markdown
Contributor

one thing is missing: we're not cleaning those configs when removing the service. for that you need to hook into

def purge(self, service_name: str) -> None:
"""Called to carry out any purge tasks following service removal"""
logger.debug(f'Purge called for {self.TYPE} - no action taken')

@sebastian-philipp
sebastian-philipp merged commit 6434723 into ceph:master Feb 26, 2021
@sebastian-philipp

sebastian-philipp commented Feb 26, 2021 •

Copy link
Copy Markdown
Contributor

I have a slight impression that this feature is a bit too generic. I wonder if we'll get tracker issues, cause this is a bit too generic. I don't know if we should advertise this as a cool new feature just yet. To some degree this feels like #37106 which we already know is not properly supported when upgrading.

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.

2 participants