refactor: use cli context vs creating new one
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2021-09-16 11:17:56 +01:00
parent a74a8bc21b
commit 0a1c73bf00
8 changed files with 26 additions and 41 deletions

View File

@ -1,7 +1,6 @@
package app
import (
"context"
"fmt"
abraFormatter "coopcloud.tech/abra/cli/formatter"
@ -20,8 +19,7 @@ var appVolumeListCommand = &cli.Command{
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
ctx := context.Background()
volumeList, err := client.GetVolumes(ctx, app.Server, app.Name)
volumeList, err := client.GetVolumes(c.Context, app.Server, app.Name)
if err != nil {
logrus.Fatal(err)
}
@ -53,8 +51,7 @@ var appVolumeRemoveCommand = &cli.Command{
Action: func(c *cli.Context) error {
app := internal.ValidateApp(c)
ctx := context.Background()
volumeList, err := client.GetVolumes(ctx, app.Server, app.Name)
volumeList, err := client.GetVolumes(c.Context, app.Server, app.Name)
if err != nil {
logrus.Fatal(err)
}
@ -74,7 +71,7 @@ var appVolumeRemoveCommand = &cli.Command{
volumesToRemove = volumeNames
}
err = client.RemoveVolumes(ctx, app.Server, volumesToRemove, internal.Force)
err = client.RemoveVolumes(c.Context, app.Server, volumesToRemove, internal.Force)
if err != nil {
logrus.Fatal(err)
}