Skip to content

install.sh: instance size menu does not pre-select the default size #134

Open

Description

@royosherove

install.sh L2579-2583:

_gum_or_die size_choice $GUM choose --header "Instance size" \
  --selected "${default_type}  — recommended" \
  "t4g.medium  — 2 vCPU,  4GB  ~\$25/mo   light use" \
  "t4g.large   — 2 vCPU,  8GB  ~\$50/mo   regular use" \
  "t4g.xlarge  — 4 vCPU, 16GB  ~\$100/mo  recommended" || size_choice=""

Problem: gum choose --selected must get the full option text. The text "t4g.xlarge — recommended" is not equal to any option, so no option is pre-selected and the cursor stays on t4g.medium. If the user pushes Enter, the installer deploys t4g.medium, also when the pack needs a larger minimum size (L2556-2572).

Fix: Map default_type to its full option label and pass that label to --selected. For example:

local sel
case "$default_type" in
  t4g.medium) sel="t4g.medium  — 2 vCPU,  4GB  ~\$25/mo   light use" ;;
  t4g.large)  sel="t4g.large   — 2 vCPU,  8GB  ~\$50/mo   regular use" ;;
  *)          sel="t4g.xlarge  — 4 vCPU, 16GB  ~\$100/mo  recommended" ;;
esac

Found by a code read at commit 1e50295. The code was read, but not run on a real instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions