Raise usage errors if inappropriate hab svc load
options are given in hab sup run
#7646
Labels
Focus: CLI
Related to the Habitat CLI (core/hab) component
Focus:Supervisor
Related to the Habitat Supervisor (core/hab-sup) component
Stale
Type: Bug
Issues that describe broken functionality
hab sup run
is used to start a Supervisor, andhab svc load
is used to instruct a running Supervisor to load a new service.However, as a way to have allow Habitat containers to start-and-load a service in a single
ENTRYPOINT
,hab sup run
takes options and arguments ofhab svc load
to effectively perform both operations at once.However, this has led to confusion, in that it is currently possible to provide
hab svc load
options tohab sup run
commands that have no effect, but are not marked as errors.For example,
hab sup run --topology=leader
is legal, and a Supervisor starts up, but it makes no sense, as--topology
concerns how services run, not how Supervisors run. As a result, some users talk about "running a Supervisor in a leader topology". This is wrong, and needlessly confusing.(A more correct invocation would be
hab sup run core/redis --topology=leader
, which says "Start a Supervisor, and then load and runcore/redis
as a service in a leader topology".)Other scenarios can be presented for all the other
hab svc load
options that are provided tohab sup run
without also providing the package identifier of the service they should apply to.While it would be nice to ultimately tease these two commands apart more completely, for the near term we should adjust our CLI code to better document such instances, as well as catch them as errors when they are invoked. This will help to make it more clear what the distinction between Supervisors and Services is.
The text was updated successfully, but these errors were encountered: