Skip to content

Commit 426687b

Browse files
authored
Merge pull request #1487 from carlossg/preservecontext
fix: do not overwrite current context
2 parents 2ff4bb1 + a7d015a commit 426687b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export class KubeConfig {
259259
}
260260

261261
public mergeConfig(config: KubeConfig, preserveContext: boolean = false): void {
262-
if (!preserveContext) {
262+
if (!preserveContext && config.currentContext) {
263263
this.currentContext = config.currentContext;
264264
}
265265
config.clusters.forEach((cluster: Cluster) => {

0 commit comments

Comments
 (0)