Skip to content

Commit

Permalink
Ignore nil errors in SystemdMounter.ensureCredentialsDirExists
Browse files Browse the repository at this point in the history
Signed-off-by: Burak Varlı <[email protected]>
  • Loading branch information
unexge committed Dec 31, 2024
1 parent 545e24d commit b7e02ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/driver/node/mounter/systemd_mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ func (m *SystemdMounter) Unmount(target string) error {
// It returns credentials dir and any error.
func (m *SystemdMounter) ensureCredentialsDirExists(target string) (string, error) {
credentialsBasepath := m.credentialsDir(target)
if err := os.Mkdir(credentialsBasepath, credentialprovider.CredentialDirPerm); !errors.Is(err, fs.ErrExist) {
err := os.Mkdir(credentialsBasepath, credentialprovider.CredentialDirPerm)
if err != nil && !errors.Is(err, fs.ErrExist) {
klog.V(4).Infof("NodePublishVolume: Failed to create credentials directory for %s: %v", target, err)
return "", err
}
Expand Down

0 comments on commit b7e02ac

Please sign in to comment.