superfly / flyctl

Command line tools for fly.io services
https://fly.io
Apache License 2.0
1.41k stars 236 forks source link

FLY_ORG is not respected by org-level commands #2757

Closed indirect closed 1 year ago

indirect commented 1 year ago

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

Setting the FLY_ORG env var does not replace -o in org-level commands. According to @michaeldwan, this is a bug: https://community.fly.io/t/flyctl-feature-request-fly-org-env-var/15099/4.

Command output:

❯ fly apps list -o personal
NAME            OWNER           STATUS          PLATFORM        LATEST DEPLOY        
twumblr         personal        deployed        machines        2023-05-26T01:47:41Z

❯ FLY_ORG=personal fly apps list
NAME                            OWNER           STATUS          PLATFORM        LATEST DEPLOY        
twumblr                         personal        deployed        machines        2023-05-26T01:47:41Z
feedyouremail                   feedyouremail   deployed        machines        2023-08-21T23:55:15Z

Expected results are for both commands to produce the same results, an org-filtered list of apps.

redjonzaci commented 1 year ago

@indirect do you only need it to work for fly apps list?

indirect commented 1 year ago

No. I want to use it with every single fly command that accepts a -o / --organization flag.

redjonzaci commented 1 year ago

I understand, thank you!

redjonzaci commented 1 year ago

I will try to make an initial implementation for fly apps list where the FLY_ORG env var takes priority.

I identified the following commands that use org argument or --org flag currently:

redjonzaci commented 1 year ago

I did an initial implementation as fast as I could, now we wait for a Fly employee to look at that or provide a better implementation. ☺️

redjonzaci commented 1 year ago

@indirect The solution for this is part of v0.1.85-pre-1 pre-release. You can try it by running the command for "installing the latest pre-release version": (there doesn't seem to be an option for Windows?)

curl -L https://fly.io/install.sh | sh -s pre

I don't know how it makes it from a pre-release to a release, but thought to let you know!

indirect commented 1 year ago

@redjonzaci thank you! 🙌🏻

dangra commented 1 year ago

thanks @indirect for the report and @redjonzaci for a well rounded fix!