Skip to content

Commit

Permalink
fix(krb5): fix delete keytab err when file not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuagang committed Jan 9, 2025
1 parent 540938b commit 02676a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kerberos/kadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (k *Kadmin) Ktadd(principals ...string) ([]byte, error) {
if closeErr := tmpFile.Close(); closeErr != nil {
kadminLogger.Error(closeErr, "Failed to close temporary keytab file")
}
if err := os.Remove(keytab); err != nil {
if err := os.RemoveAll(keytab); err != nil {
kadminLogger.Error(err, "Failed to remove keytab")
}
}()
Expand Down

0 comments on commit 02676a0

Please sign in to comment.