Skip to content

Commit 1e2a8c1

Browse files
committed
fix: fix nil pointer in check kube context
1 parent 0f87065 commit 1e2a8c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/devspace/kubectl/client.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,15 @@ func (client *client) IsInCluster() bool {
210210

211211
// PrintWarning prints a warning if the last kube context is different than this one
212212
func (client *client) CheckKubeContext(generatedConfig *generated.Config, noWarning bool, log log.Logger) (Client, error) {
213-
lastConfigContext := generatedConfig.GetActive().LastContext
214213
currentConfigContext := &generated.LastContextConfig{
215214
Namespace: client.Namespace(),
216215
Context: client.CurrentContext(),
217216
}
217+
218218
resetClient := false
219-
220219
if generatedConfig != nil && log.GetLevel() >= logrus.InfoLevel && !noWarning {
220+
lastConfigContext := generatedConfig.GetActive().LastContext
221+
221222
// print warning if context or namespace has changed since last deployment process (expect if explicitly provided as flags)
222223
if lastConfigContext != nil {
223224
// if the current kubeContext!=last kubeContext

0 commit comments

Comments
 (0)