Skip to content

Commit

Permalink
feat: glasskube purge use clicontext.ConfigFromContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Aryakoste committed Jun 19, 2024
1 parent a7b859f commit bfe39e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd/glasskube/cmd/purge.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"github.com/fatih/color"
"github.com/glasskube/glasskube/internal/clicontext"
"github.com/glasskube/glasskube/internal/cliutils"
"github.com/glasskube/glasskube/internal/config"
"github.com/glasskube/glasskube/pkg/bootstrap"
"github.com/glasskube/glasskube/pkg/purge"
"github.com/glasskube/glasskube/pkg/statuswriter"
Expand All @@ -28,9 +27,9 @@ var purgeCmd = &cobra.Command{
Args: cobra.NoArgs,
PreRun: cliutils.SetupClientContext(false, &rootCmdOptions.SkipUpdateCheck),
Run: func(cmd *cobra.Command, args []string) {
cfg, _ := cliutils.RequireConfig(config.Kubeconfig)
client := purge.NewPurger(cfg)
ctx := cmd.Context()
cfg := clicontext.ConfigFromContext(ctx)
client := purge.NewPurger(cfg)

if !rootCmdOptions.NoProgress {
client.WithStatusWriter(statuswriter.Spinner())
Expand Down

0 comments on commit bfe39e6

Please sign in to comment.