detached 656a810

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:
3636 gordon config show --json
3737 gordon config show --remote https://gordon.mydomain.com --token $TOKEN`,
3838 RunE: func(cmd *cobra.Command, _ []string) error {
39- ctx := context.Background()
39+ ctx := cmd.Context()
4040 handle, err := resolveControlPlane(configPath)
4141 if err != nil {
4242 return err
@@ -36,7 +36,7 @@ Examples:
36 gordon config show --json36 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 err42 return err
M internal/adapters/in/cli/images.go +1 -1
@@ -146,7 +146,7 @@ Examples:
146146 gordon images tags myapp --remote https://gordon.mydomain.com --token $TOKEN`,
147147 Args: cobra.ExactArgs(1),
148148 RunE: func(cmd *cobra.Command, args []string) error {
149- ctx := context.Background()
149+ ctx := cmd.Context()
150150 handle, err := resolveControlPlane(configPath)
151151 if err != nil {
152152 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 err152 return err
M internal/adapters/in/cli/networks.go +1 -1
@@ -36,7 +36,7 @@ Examples:
3636 gordon networks list --json
3737 gordon networks list --remote https://gordon.mydomain.com --token $TOKEN`,
3838 RunE: func(cmd *cobra.Command, _ []string) error {
39- ctx := context.Background()
39+ ctx := cmd.Context()
4040 handle, err := resolveControlPlane(configPath)
4141 if err != nil {
4242 return err
@@ -36,7 +36,7 @@ Examples:
36 gordon networks list --json36 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 err42 return err
M internal/adapters/in/cli/routes.go +1 -1
@@ -149,7 +149,7 @@ Examples:
149149 gordon routes show app.mydomain.com --remote https://gordon.mydomain.com`,
150150 Args: cobra.ExactArgs(1),
151151 RunE: func(cmd *cobra.Command, args []string) error {
152- ctx := context.Background()
152+ ctx := cmd.Context()
153153 handle, err := resolveControlPlane(configPath)
154154 if err != nil {
155155 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 err155 return err

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close