diff --git a/controllers/imageupdateautomation_controller.go b/controllers/imageupdateautomation_controller.go index 6b0896db..b3d4a6ba 100644 --- a/controllers/imageupdateautomation_controller.go +++ b/controllers/imageupdateautomation_controller.go @@ -509,8 +509,8 @@ func commitChangedManifests(repo *gogit.Repository, absRepoPath string, ent *ope // go-git has [a bug](https://github.com/go-git/go-git/issues/253) // whereby it thinks broken symlinks to absolute paths are - // modified; and, there's no circumstance in which we want to - // commit a change to a broken symlink: so, skip those. + // modified. There's no circumstance in which we want to commit a + // change to a broken symlink: so, detect and skip those. var changed bool for file, _ := range status { abspath := filepath.Join(absRepoPath, file) @@ -520,13 +520,10 @@ func commitChangedManifests(repo *gogit.Repository, absRepoPath string, ent *ope } if info.Mode()&os.ModeSymlink > 0 { // symlinks are OK; broken symlinks are probably a result - // of the bug mentioned above, but not of interest anyway. - if _, err := os.Readlink(abspath); err != nil { - return "", fmt.Errorf("problem reading symlink: %w", err) - } else { - if _, err := os.Stat(abspath); os.IsNotExist(err) { - continue - } + // of the bug mentioned above, but not of interest in any + // case. + if _, err := os.Stat(abspath); os.IsNotExist(err) { + continue } } working.Add(file)