Skip to content

Commit a5fb7f8

Browse files
authored
fix(k8s): fix uninstall with current context (#885)
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent 144e96f commit a5fb7f8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/namespaces/k8s/v1/custom_kubeconfig_uninstall.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ func k8sKubeconfigUninstallRun(ctx context.Context, argsI interface{}) (i interf
7777
}
7878

7979
// reset the current context
80-
existingKubeconfig.CurrentContext = ""
80+
if strings.HasSuffix(existingKubeconfig.CurrentContext, request.ClusterID) {
81+
existingKubeconfig.CurrentContext = ""
82+
}
8183

8284
// write the modification
8385
existingKubeconfig.Clusters = newClusters

0 commit comments

Comments
 (0)