Skip to content

--use-reservation is parsed and never read: it silently does nothing (superseded by --reservation-id) #675

Closed

Description

@scttfrdmn

Found by TestLaunchFlagsAreWired, the class gate added with #667.

--use-reservation ("Use capacity reservation") is bound to the useReservation global in cmd/launch_flags.go:253 and nothing reads it. Passing it has no effect whatsoever.

It looks vestigial: #216 added --reservation-id (plus --capacity-block), which are wired through to LaunchConfig.ReservationID and the CapacityReservationSpecification on RunInstances. --use-reservation appears to predate that and was never removed.

Why it is worth closing rather than ignoring

The flag reads as the obvious way to ask for reserved capacity. A user who passes --use-reservation and nothing else gets an on-demand instance at on-demand price, silently — believing they targeted a reservation they are already paying for.

Fix

Most likely just remove it, via the deprecation path the repo already uses for --subnet/--security-group/--key-pair:

_ = launchCmd.Flags().MarkDeprecated("use-reservation", "use --reservation-id instead")

That keeps existing scripts working while printing a warning, instead of today's silence. If it is meant to mean "auto-select any open reservation in the region", that is a feature and should be implemented or dropped deliberately.

Listed in knownUnwiredFlags so the gate stays green until this is resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions