|
6 | 6 | "github.com/loft-sh/devspace/cmd/flags" |
7 | 7 | "github.com/loft-sh/devspace/pkg/devspace/build" |
8 | 8 | "github.com/loft-sh/devspace/pkg/devspace/config/loader" |
9 | | - "github.com/loft-sh/devspace/pkg/devspace/config/localcache" |
10 | 9 | "github.com/loft-sh/devspace/pkg/devspace/config/versions/latest" |
11 | 10 | devspacecontext "github.com/loft-sh/devspace/pkg/devspace/context" |
12 | 11 | "github.com/loft-sh/devspace/pkg/devspace/context/values" |
@@ -350,34 +349,15 @@ func initialize(ctx context.Context, f factory.Factory, options *CommandOptions, |
350 | 349 | } |
351 | 350 | devCtx = devCtx.WithDependencies(dependencies) |
352 | 351 |
|
353 | | - // update last used kube context & save generated yaml |
354 | | - err = updateLastKubeContext(devCtx) |
| 352 | + // save local cache |
| 353 | + err = localCache.Save() |
355 | 354 | if err != nil { |
356 | | - return nil, errors.Wrap(err, "update last kube context") |
| 355 | + return nil, errors.Wrap(err, "save cache") |
357 | 356 | } |
358 | 357 |
|
359 | 358 | return devCtx, nil |
360 | 359 | } |
361 | 360 |
|
362 | | -func updateLastKubeContext(ctx devspacecontext.Context) error { |
363 | | - // Update generated if we deploy the application |
364 | | - if ctx.KubeClient() != nil { |
365 | | - if ctx.Config() != nil && ctx.Config().LocalCache() != nil { |
366 | | - ctx.Config().LocalCache().SetLastContext(&localcache.LastContextConfig{ |
367 | | - Context: ctx.KubeClient().CurrentContext(), |
368 | | - Namespace: ctx.KubeClient().Namespace(), |
369 | | - }) |
370 | | - |
371 | | - err := ctx.Config().LocalCache().Save() |
372 | | - if err != nil { |
373 | | - return errors.Wrap(err, "save generated") |
374 | | - } |
375 | | - } |
376 | | - } |
377 | | - |
378 | | - return nil |
379 | | -} |
380 | | - |
381 | 361 | func runWithHooks(ctx devspacecontext.Context, command string, fn func() error) (err error) { |
382 | 362 | err = hook.ExecuteHooks(ctx, nil, command+":before:execute") |
383 | 363 | if err != nil { |
|
0 commit comments