Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mgr/cephadm: validate host label before removing #51817

Merged
merged 1 commit into from Jun 14, 2023

Conversation

rkachach
Copy link
Contributor

Fixes: https://tracker.ceph.com/issues/61494

Contribution Guidelines

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
  • 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 dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@rkachach rkachach requested a review from a team as a code owner May 29, 2023 16:15
@phlogistonjohn
Copy link
Contributor

phlogistonjohn commented May 29, 2023

When working on mgr modules in other contexts I've been asked not to raise errors when the action could be made idempotent. You could argue that removing a label that doesn't exist is just one of those cases (think rm -f vs. rm). I looked at the linked tracker and it seems to me that the command doesn't raise an error and silently succeeds, right? If so, one could argue that the current behavior is already correct. The tracker doesn't make clear why silently succeeding is a problem.

Fixes: https://tracker.ceph.com/issues/61494

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
@rkachach
Copy link
Contributor Author

When working on mgr modules in other contexts I've been asked not to raise errors when the action could be made idempotent. You could argue that removing a label that doesn't exist is just one of those cases (think rm -f vs. rm). I looked at the linked tracker and it seems to me that the command doesn't raise an error and silently succeeds, right? If so, one could argue that the current behavior is already correct. The tracker doesn't make clear why silently succeeding is a problem.

@phlogistonjohn maybe as you said raising an error in this case is kind of overreacting (though in the example of rm in case the file/dir doesn't exist it fails and it only succeeds if you force it by -f). In the new code I just print an info message warning the user that the label doesn't exist.

@phlogistonjohn
Copy link
Contributor

When working on mgr modules in other contexts I've been asked not to raise errors when the action could be made idempotent. You could argue that removing a label that doesn't exist is just one of those cases (think rm -f vs. rm). I looked at the linked tracker and it seems to me that the command doesn't raise an error and silently succeeds, right? If so, one could argue that the current behavior is already correct. The tracker doesn't make clear why silently succeeding is a problem.

@phlogistonjohn maybe as you said raising an error in this case is kind of overreacting (though in the example of rm in case the file/dir doesn't exist it fails and it only succeeds if you force it by -f). In the new code I just print an info message warning the user that the label doesn't exist.

From the code & commit message it wasn't clear to me that it is "just" a warning. I'm fine with that, thanks!

@adk3798
Copy link
Contributor

adk3798 commented May 30, 2023

jenkins test make check

@adk3798 adk3798 merged commit fb86d5e into ceph:main Jun 14, 2023
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants