[#113] cli: add "name" option for "get container" command #224
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#224
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:feature/113-get_cnr_by_name"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
9e74ca577c
tod490e526e4
d490e526e4
toafaaa9b727
afaaa9b727
toc311532acb
WIP: [#113] cli: add "name" option for "get container" commandto [#113] cli: add "name" option for "get container" command@ -0,0 +65,4 @@
}
cnr := res.Container()
if searchVarNameFlag != "" && container.Name(cnr) == searchVarNameFlag {
Can we check first condition at the beginning of searchContainer() or earlier? Maybe also will be useful to search by the pat of the name?
We may add regexp for this case
search --name *test_name*
. Using the option like that is more predictableWe can, but it could become less obvious: dot will match any symbol, etc.
Glancing at bucket names like
9d6c424a-7a69-4662-836...
I agreed to make searching for the string as part of the container name. It's really usefulMaybe we better add this flag to already existing
list
command? @carpawellThis was my first assumption but I came to the conclusion that using
--name
inlist
(and, probably, other filter option in the future) is not obvious and inutively convinient.list
just lists container names or their attributes withour pretty printing and let's keep it like thatAgree.
c311532acb
to9c384d03c7
I moved this option to
list
command for comfortable usage for everyone and removedsearch
9c384d03c7
to8c6d856958
8c6d856958
to2ad7966284
@ -58,0 +64,4 @@
continue
}
if cnrName := containerSDK.Name(res.Container()); flagListName != "" && !strings.Contains(cnrName, flagVarListName) {
I think
!strings.Contains
is too unexpected, let's stick with the exact name for now.OK
2ad7966284
toe274b7a612
@ -58,0 +58,4 @@
containerList := res.IDList()
for _, cnr := range containerList {
prmGet.SetContainer(cnr)
res, err := internalclient.GetContainer(prmGet)
It is not necessary to get container if
flagListName
is empty. Also it is possible to use result from here whenflagVarListPrintAttr
set to true.I fixed this but anyway getting the container doesn't seem to burden the iteration :)
@ -58,0 +64,4 @@
continue
}
if cnrName := containerSDK.Name(res.Container()); flagListName != "" && cnrName != flagVarListName {
This line doesn't match description:
List containers only by the whole attribute name or only by the name part
. Or did I miss something?Thanks! Forgot to fix after changes. Fixed
e274b7a612
todde9f9d2e4