Skip to content

Commit

Permalink
Log file deletion error
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonAM committed Jun 2, 2023
1 parent 92f04a5 commit f7570ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/client/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ limitations under the License.
package client

import (
"errors"
iofs "io/fs"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -245,7 +247,10 @@ func (fs *FSKeyStore) DeleteKey(idx KeyIndex) error {
}

// And try to delete kube credentials lockfile in case it exists
_ = os.Remove(fs.kubeCredLockfilePath(idx))
err := os.Remove(fs.kubeCredLockfilePath(idx))
if err != nil && !errors.Is(err, iofs.ErrNotExist) {
log.Debugf("Could not remove kube credentials file: %v", err)
}

// Clear ClusterName to delete the user certs stored for all clusters.
idx.ClusterName = ""
Expand Down

0 comments on commit f7570ad

Please sign in to comment.