fix: use cmd.Context() instead of context.Background() in new commands
- commit
- 656a8107d6dc8f8b983b4ba358f2540ceacf6cfb
- author
- brice · · 2026-03-14 03:35 UTC
- parent
- 17c1805
- signature
- unsigned
4 files · +4 -4
M internal/adapters/in/cli/config.go +1 -1
| @@ -36,7 +36,7 @@ Examples: | |||
| 36 | 36 | gordon config show --json | |
| 37 | 37 | gordon config show --remote https://gordon.mydomain.com --token $TOKEN`, | |
| 38 | 38 | RunE: func(cmd *cobra.Command, _ []string) error { | |
| 39 | - | ctx := context.Background() | |
| 39 | + | ctx := cmd.Context() | |
| 40 | 40 | handle, err := resolveControlPlane(configPath) | |
| 41 | 41 | if err != nil { | |
| 42 | 42 | return err | |
| @@ -36,7 +36,7 @@ Examples: | |||||
| 36 | gordon config show --json | 36 | gordon config show --json | ||
| 37 | gordon config show --remote https://gordon.mydomain.com --token $TOKEN`, | 37 | gordon config show --remote https://gordon.mydomain.com --token $TOKEN`, | ||
| 38 | RunE: func(cmd *cobra.Command, _ []string) error { | 38 | RunE: func(cmd *cobra.Command, _ []string) error { | ||
| 39 | - | ctx := context.Background() | 39 | + | ctx := cmd.Context() |
| 40 | handle, err := resolveControlPlane(configPath) | 40 | handle, err := resolveControlPlane(configPath) | ||
| 41 | if err != nil { | 41 | if err != nil { | ||
| 42 | return err | 42 | return err | ||
M internal/adapters/in/cli/images.go +1 -1
| @@ -146,7 +146,7 @@ Examples: | |||
| 146 | 146 | gordon images tags myapp --remote https://gordon.mydomain.com --token $TOKEN`, | |
| 147 | 147 | Args: cobra.ExactArgs(1), | |
| 148 | 148 | RunE: func(cmd *cobra.Command, args []string) error { | |
| 149 | - | ctx := context.Background() | |
| 149 | + | ctx := cmd.Context() | |
| 150 | 150 | handle, err := resolveControlPlane(configPath) | |
| 151 | 151 | if err != nil { | |
| 152 | 152 | return err | |
| @@ -146,7 +146,7 @@ Examples: | |||||
| 146 | gordon images tags myapp --remote https://gordon.mydomain.com --token $TOKEN`, | 146 | gordon images tags myapp --remote https://gordon.mydomain.com --token $TOKEN`, | ||
| 147 | Args: cobra.ExactArgs(1), | 147 | Args: cobra.ExactArgs(1), | ||
| 148 | RunE: func(cmd *cobra.Command, args []string) error { | 148 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 149 | - | ctx := context.Background() | 149 | + | ctx := cmd.Context() |
| 150 | handle, err := resolveControlPlane(configPath) | 150 | handle, err := resolveControlPlane(configPath) | ||
| 151 | if err != nil { | 151 | if err != nil { | ||
| 152 | return err | 152 | return err | ||
M internal/adapters/in/cli/networks.go +1 -1
| @@ -36,7 +36,7 @@ Examples: | |||
| 36 | 36 | gordon networks list --json | |
| 37 | 37 | gordon networks list --remote https://gordon.mydomain.com --token $TOKEN`, | |
| 38 | 38 | RunE: func(cmd *cobra.Command, _ []string) error { | |
| 39 | - | ctx := context.Background() | |
| 39 | + | ctx := cmd.Context() | |
| 40 | 40 | handle, err := resolveControlPlane(configPath) | |
| 41 | 41 | if err != nil { | |
| 42 | 42 | return err | |
| @@ -36,7 +36,7 @@ Examples: | |||||
| 36 | gordon networks list --json | 36 | gordon networks list --json | ||
| 37 | gordon networks list --remote https://gordon.mydomain.com --token $TOKEN`, | 37 | gordon networks list --remote https://gordon.mydomain.com --token $TOKEN`, | ||
| 38 | RunE: func(cmd *cobra.Command, _ []string) error { | 38 | RunE: func(cmd *cobra.Command, _ []string) error { | ||
| 39 | - | ctx := context.Background() | 39 | + | ctx := cmd.Context() |
| 40 | handle, err := resolveControlPlane(configPath) | 40 | handle, err := resolveControlPlane(configPath) | ||
| 41 | if err != nil { | 41 | if err != nil { | ||
| 42 | return err | 42 | return err | ||
M internal/adapters/in/cli/routes.go +1 -1
| @@ -149,7 +149,7 @@ Examples: | |||
| 149 | 149 | gordon routes show app.mydomain.com --remote https://gordon.mydomain.com`, | |
| 150 | 150 | Args: cobra.ExactArgs(1), | |
| 151 | 151 | RunE: func(cmd *cobra.Command, args []string) error { | |
| 152 | - | ctx := context.Background() | |
| 152 | + | ctx := cmd.Context() | |
| 153 | 153 | handle, err := resolveControlPlane(configPath) | |
| 154 | 154 | if err != nil { | |
| 155 | 155 | return err | |
| @@ -149,7 +149,7 @@ Examples: | |||||
| 149 | gordon routes show app.mydomain.com --remote https://gordon.mydomain.com`, | 149 | gordon routes show app.mydomain.com --remote https://gordon.mydomain.com`, | ||
| 150 | Args: cobra.ExactArgs(1), | 150 | Args: cobra.ExactArgs(1), | ||
| 151 | RunE: func(cmd *cobra.Command, args []string) error { | 151 | RunE: func(cmd *cobra.Command, args []string) error { | ||
| 152 | - | ctx := context.Background() | 152 | + | ctx := cmd.Context() |
| 153 | handle, err := resolveControlPlane(configPath) | 153 | handle, err := resolveControlPlane(configPath) | ||
| 154 | if err != nil { | 154 | if err != nil { | ||
| 155 | return err | 155 | return err | ||