image-automation-controller/controllers/testdata
Michael Bridgen cd895637b5 Ignore broken symlinks in commit
There is a bug in go-git which leads to it reporting broken, absolute
symlinks as modified whether they are or not:

    https://github.com/go-git/go-git/issues/253

To date, the controller checks whether the repo it has run an update
on is Clean, and as a consequence will run into the bug above if a
broken symlink is in the repo. The result is that it makes and pushes
an empty commit every interval.

To work around the problem, this commit adds a more careful check of
the repo status. Each file reported as modified is validated by
checking specifically that it's not a broken symlink: if `os.Lstat`
says it's a symlink and `os.Stat` reports the (target) file is
missing, it can be ignored. (Why not just ignore any missing file?
Because a missing file might indicate some other problem, so better to
let it fail).

For convenience, I have moved a few procedures around so they can be
used more readily by go tests.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-05 11:43:15 +01:00
..
appconfig Preserve line-end comments when replacing image 2020-09-29 12:19:12 +01:00
appconfig-expected Preserve line-end comments when replacing image 2020-09-29 12:19:12 +01:00
appconfig-expected2 Preserve line-end comments when replacing image 2020-09-29 12:19:12 +01:00
appconfig-setters-expected Use UpdateWithSetters in controller 2020-10-13 21:00:13 +01:00
brokenlink Ignore broken symlinks in commit 2021-04-05 11:43:15 +01:00
pathconfig Add update path test 2021-03-16 15:31:34 +02:00