-
Notifications
You must be signed in to change notification settings - Fork 302
fleetctl: destroy using wildcards can search in the repository #1256
Conversation
Curerntly, fleetctl destroy *.service, it will search the units in the local directory. The args with wildcards have already parsed by golang package before be passed into runDestroyUnits. So runDestroyUnits cannot do anything. This patch support wildcards just search in the repository, not from local directory. But need support a new interface. The new interface is: fleetctl destroy "xx*.service". We found that if bracket the service name, the arg will not be parsed by golang package to local directory. Then we can do match it with the service name in the repository. Fixes coreos#710
I don't want to support this just for
|
|
Let's try to sum up the current situation:
(For the commands operating on a single unit -- such as "cat", "journal" etc. -- it would be possible in principle to support globbing as well, as long as only a single unit is actually matched. The benefit of that would be rather disputable though -- I'd tend to skip these.)
I guess the impact could be mostly mitigated by trying to check up front whether any of the arguments supplied looks like a glob pattern. That would result in a gotcha though: don't use globbing if you have a lot of services... |
Oh, one more thing I forgot to mention: obviously this needs a bunch of new test cases on top of everything else. |
In the absence of more people clamouring for this feature I am kind of leaning towards just closing this as wontfix. I don't see a really strong use case for it and something essentially equivalent can be easily mimicked with a shell one-liner. @antrik what do you think? |
@jonboulle well, as I'm not actually a fleet user, I only have a vague idea of how much value it would add... I tend to agree though that it doesn't look really important. If someone else feels like picking it up, I wouldn't mind getting it in; but I guess we shouldn't spend our resources on this. |
Let's revisit if there's further demand. |
Curerntly, fleetctl destroy *.service, it will search the units
in the local directory. The args with wildcards have already parsed
by golang package before be passed into runDestroyUnits. So
runDestroyUnits cannot do anything.
This patch support wildcards just search in the repository,
not from local directory. But need support a new interface. The new
interface is:
fleetctl destroy "xx*.service".
We found that if bracket the service name, the arg will not be
parsed by golang package to local directory. Then we can do match it
with the service name in the repository.
Fixes #710