Skip to content

Commit 94a160d

Browse files
authored
fix: reorder cluster check in GetCrateKubeconfig function (#3)
1 parent 1d4412c commit 94a160d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/utils/kubeconfig.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ func GetCrateKubeconfig() (k8s.KubeConfig, bool) {
2323
defer crateKubeconfig.mu.RUnlock()
2424

2525
config := crateKubeconfig.kubeconfig
26-
if len(config.Clusters) == 0 {
27-
return config, false
28-
}
29-
3026
deepCopiedUsers := make([]k8s.UserListEntry, len(config.Users))
3127
copy(deepCopiedUsers, config.Users)
3228
config.Users = deepCopiedUsers
3329

30+
if len(config.Clusters) == 0 {
31+
return config, false
32+
}
33+
3434
return config, true
3535
}
3636

0 commit comments

Comments
 (0)