Commit 211e677
committed
cephadm: support --infer-name option for lazy devs
Add an --infer-name/-i option to the cephadm enter command. This new
option is a spin on --name/-n but allows the value to be partial.
The first part of the value must be a service type (like `mgr`, `mds`,
`nfs`, etc). That can then be followed optionally by a dot (.) and
a part (or whole) of an id. For example:
Enter the one and only mgr container running on this host:
```
cephadm enter -i mgr
```
Enter a (primary) smb container running on this host belonging to
the virtual cluster "cluster1", without specifying random chars or
rank values:
```
cephadm enter -i smb.cluster1
```
If the partial name does not match any services on the host or it
matches more than 1 service on the host it will return an error.
In the case of >1 service you can then supply more characters in
the partial id to narrow down the match. For example:
```
cephadm enter -i osd
Inferring fsid bf7116b2-2b9d-11f0-bb35-525400220000
ERROR: too many daemons match 'osd' (osd.2, osd.5)
/tmp/cephadm enter -i osd.2
Inferring fsid bf7116b2-2b9d-11f0-bb35-525400220000
Inferring daemon osd.2
[ceph: root@ceph0 /]#
```
Signed-off-by: John Mulligan <[email protected]>1 parent e8b8c95 commit 211e677
2 files changed
+67
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
3151 | 3151 | | |
3152 | 3152 | | |
3153 | 3153 | | |
3154 | | - | |
3155 | | - | |
3156 | | - | |
3157 | | - | |
3158 | | - | |
3159 | | - | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
3160 | 3157 | | |
3161 | 3158 | | |
3162 | 3159 | | |
| |||
3168 | 3165 | | |
3169 | 3166 | | |
3170 | 3167 | | |
| 3168 | + | |
3171 | 3169 | | |
3172 | 3170 | | |
3173 | 3171 | | |
3174 | | - | |
3175 | 3172 | | |
3176 | 3173 | | |
3177 | 3174 | | |
| |||
4767 | 4764 | | |
4768 | 4765 | | |
4769 | 4766 | | |
4770 | | - | |
| 4767 | + | |
| 4768 | + | |
4771 | 4769 | | |
4772 | | - | |
4773 | 4770 | | |
| 4771 | + | |
| 4772 | + | |
| 4773 | + | |
4774 | 4774 | | |
4775 | 4775 | | |
4776 | 4776 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
0 commit comments