Commit Graph

4 Commits

Author SHA1 Message Date
Michael Bridgen f011f2334e Thread debug/tracing through controller and pkg/
This commit finesses the use of the debug log a little, and introduces
a trace log. The trace log gets threaded through calls to utility
procedures -- it's a little awkward putting loggers into func
parameters and structs, but it always is.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-06-23 10:57:04 +01:00
nguyenductoan 0506b974e8 fix comment typo
Signed-off-by: nguyenductoan <ductoan593@gmail.com>
2021-01-07 16:11:27 +07:00
Michael Bridgen 05832c5fd4 Give new and lacking files a copyright notice
In general a copyright notice takes the form:

    Copyright year name

.. where the year is the year of first publication, to let people know
from when the copyright applies. It's fairly common in software to
affix additional years in which the software was modified and
released. I have chosen here to use `2020, 2021` for the new and
modified files; it is OK that not _all_ files are updated, since the
important bit is the _first_ year, which they already have.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-04 15:19:59 +00:00
Michael Bridgen 8eec8c095c Screen files, and output only those updated
This is intended to address two problems:

 - LocalPackage{Reader,Writer} like to reformat the YAML that passes
   through them; mostly this is harmless, but occasionally it will end
   up fighting format tooling, e.g., prettier.

 - It's possible that things like Helm chart templates are lying
   around in the git repository to which automation is applied. Those
   templates have extensions of ".yaml" but are not usually parseable
   as YAML, so would result in errors from the file reader.

This commit changes how updates are run -- firstly, it screens files
by checking for a token (`"$imagepolicy"`) that will be present in
files that might need updating. This cheaply removes some nodes --
likely including Helm chart templates -- from consideration.

Secondly, it now only writes files that were actually updated by an
imagepolicy setter, rather than writing everything that was an
input. This means it's less likely to reformat something that doesn't
need to be touched at all.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-04 14:44:42 +00:00