refactor: use cli context vs creating new one
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user