Skip to content

Commit

Permalink
Merge pull request #173 from nhanus/master
Browse files Browse the repository at this point in the history
fix windows file access handling
  • Loading branch information
nvthongswansea authored Apr 2, 2024
2 parents b79bdd3 + 8ad2631 commit f5a7195
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,10 @@ func loadCachedKubeConfig(id string) (*clientauth.ExecCredential, error) {
timeStamp := execCredential.Status.ExpirationTimestamp

if execCredential.Status == nil || timeStamp.IsZero() || timeStamp.Time.Before(time.Now()) {
err = os.Remove(kubeConfigPath)
err = f.Close()
if err == nil {
err = os.Remove(kubeConfigPath)
}
return nil, err
}

Expand Down

0 comments on commit f5a7195

Please sign in to comment.