FLY_ORG env var is not respected by redis or pg subcommands

Open
#2,883 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go
Domain
cli

Research direction

Start with the fly pg and fly redis subcommands that handle org context, and compare their behavior with commands such as fly apps that already use FLY_ORG. Verify the list commands filter by the environment-selected org and that create and related commands receive the equivalent --org value.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
Briefly, describe what broke and provide the following details:

The fly pg and fly redis commands both have a bunch of subcommands that operate in an org context, like list, create, etc. However, both commands ignore the FLY_ORG env var, which can be used to set an org for other commands like fly apps.

  • macOS Ventura 13.6
  • fly v0.1.104 darwin/arm64 Commit: 682c341cb1b8fc0bc80589fd96d7cad34f1772f0 BuildDate: 2023-09-29T15:46:28Z

** Paste your fly.toml

none

** Command output: **

❯ FLY_ORG=sunchaser fly redis list
NAME                    ORG             PLAN    EVICTION        PRIMARY REGION  READ REGIONS 
feedyouremail           feedyouremail   Free    Enabled         sjc                         
sunchaser-redis-cache   sunchaser       Free    Enabled         sjc                         
sunchaser-redis         sunchaser       200M    Disabled        sjc  
❯ FLY_ORG=sunchaser fly pg list
NAME                            OWNER           STATUS          LATEST DEPLOY 
rocket-db                       personal        suspended                    
feedyouremail-db                feedyouremail   deployed                     
feedyouremail-staging-db        feedyouremail   suspended                    
sunchaser-db                    sunchaser       deployed                     
sunchaser-preview-db            sunchaser       deployed                     
sunchaser-staging-db            sunchaser       deployed                     

Expected result:

Setting FLY_ORG should filter list by org, and set the --org flag on create, etc.

Dominant language
Go
Stars
1.7k
Forks
311
Avg merge
12h 50m
Merged PRs (30d)
78

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from superfly/flyctl

All issues in superfly/flyctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.