Skip to content

Commit

Permalink
fix(krb5): fix delete tmp file err when not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuagang committed Jan 10, 2025
1 parent 9c99e8f commit 1cd41fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/kerberos/kadmin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package kerberos

import (
"crypto/sha256"
"encoding/hex"
"fmt"
"os"
"os/exec"
Expand Down Expand Up @@ -101,7 +99,7 @@ func (k *Kadmin) Query(query string) (result string, err error) {

adminKeytabPath, err := k.GetAdminKeytabPath()
defer func() {
if err := os.Remove(adminKeytabPath); err != nil {
if err := os.RemoveAll(adminKeytabPath); err != nil {
logger.Error(err, "Failed to remove keytab")
}
}()
Expand Down

0 comments on commit 1cd41fe

Please sign in to comment.