Repository navigation
mgr/cephadm: fix orch host add with multiple labels and no addr - #40508
Merged
Merged
Conversation
Contributor
|
jenkins test api |
Contributor
|
Signed-off-by: Daniel Pivonka <[email protected]>
Daniel-Pivonka
force-pushed
the
cephadmorchhostaddlabelsbug
branch
from
March 31, 2021 14:16
341411c to
92ad142
Compare
Contributor
|
jenkins test make check |
| Labels can be added when adding a host with the ``--labels`` flag:: | ||
|
|
||
| ceph orch host add my_hostname --labels=my_label1 | ||
| ceph orch host add my_hostname --labels=my_label1,my_label2 |
Contributor
There was a problem hiding this comment.
Suggested change
| ceph orch host add my_hostname --labels=my_label1,my_label2 | |
| ceph orch host add my_hostname --labels=my_label1 --labels=my_label2 |
should work as well.
I'm not yet sure if I should be super happy, if we introduce a new way to pass multiple labels. I think a better way would be to extend ceph_argparse to also support comma-separated lists of elements for n=N arguments. But, understandably, no one likes touching ceph_argparse.
Contributor
liewegas
approved these changes
Apr 5, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
the first problem:
ceph orch host add provides a misleading error message if addr is not valid
switching the error message to use the addr variable will show its trying to make a connection to that address
(addr = hostname if no addr is provided)
second problem:
orch host add command can not add a host with multiple labels and no addr (its possible if you put '' in the addr positional argument)
previously using the --labels flag there was no way to specify multiple labels. everything was taken as a single large label
ex: --labels=label1,label2 would evaluate to a list of labels as ["label1,label2"]
now you can use command separated labels
ceph orch host add vm-01 --labels=label1,label2,label3
and the labels will save separately ex: ["label1","label2","labe3"]
additionally i have documented this functionality
Fixes: https://tracker.ceph.com/issues/50062
Signed-off-by: Daniel Pivonka [email protected]