Commit Graph

344 Commits

Author SHA1 Message Date
Hidde Beydals 57671bc22c
Merge pull request #80 from fluxcd/multi-arch-image
Publish as single multi-arch Docker image
2021-01-13 11:55:28 +01:00
Hidde Beydals d9cdd6f3e6 Publish as single multi-arch Docker image
This commit bundles the `image-automation-controller:$VER-arm64` ARM
image tag range that was previously released separately with the
`image-automation-controller:$VER` image, as GitHub now provides us
insights into image layer statistics.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-01-11 13:26:02 +01:00
Michael Bridgen 6ae133b9e4
Merge pull request #79 from fluxcd/point-to-guide
Remove instructions in favour of the guide
2021-01-07 12:06:45 +00:00
Michael Bridgen 2a22e6e296 Remove instructions in favour of the guide
Now there is a guide available, there's no need to have the scrappy
instructions I wrote for the README.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-07 12:03:26 +00:00
Michael Bridgen 24ceb22226
Merge pull request #78 from nguyenductoan/fix-commnet-typo
fix comment typo
2021-01-07 12:03:02 +00:00
nguyenductoan 0506b974e8 fix comment typo
Signed-off-by: nguyenductoan <ductoan593@gmail.com>
2021-01-07 16:11:27 +07:00
Michael Bridgen 285060fcb8
Merge pull request #22 from idvoretskyi/idvoretskyi-fossa
FOSSA scan enabled
2021-01-06 15:58:27 +00:00
Ihor Dvoretskyi 1496c9235b FOSSA scan enabled
Signed-off-by: Ihor Dvoretskyi <ihor@linux.com>
2021-01-06 15:50:49 +00:00
Stefan Prodan f7e205cd4d
Merge pull request #77 from fluxcd/api-v0.2.0
Bump API version to v0.2.0
2021-01-06 11:33:20 +02:00
Stefan Prodan 4c44e6dc91
Bump API version to v0.2.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-06 11:29:25 +02:00
Stefan Prodan 2c8610d6cf
Merge pull request #76 from fluxcd/release-v0.2.0
Release v0.2.0
2021-01-06 11:26:31 +02:00
Stefan Prodan fed3cca2e5
Release v0.2.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-01-06 11:06:26 +02:00
Michael Bridgen bddc6b55d5
Merge pull request #75 from fluxcd/test-push-status
Record last pushed commit in status
2021-01-05 18:26:35 +00:00
Michael Bridgen 50a4e91344 Use short hash in condition message
Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-05 17:28:35 +00:00
Michael Bridgen eb7ca1f3bd Record the last pushed SHA1 and the time it was pushed
This adds fields to the ImageUpdateAutomation status for recording the
commit last pushed; handy to see when you are expecting a change.

It also adapts the "steady state" message of the ready condition to
mention the last commit, in case that's where people are looking.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-05 17:01:13 +00:00
Michael Bridgen 0756eee4cb Test that the ready condition shows commit/push
After a change has been made, the ready condition should have a
message indicating that it pushed a commit.

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-05 16:04:05 +00:00
Michael Bridgen a45a21638a
Merge pull request #74 from fluxcd/branch-mandatory
Make the branch field mandatory
2021-01-05 12:40:45 +00:00
Michael Bridgen 308748f515 Make the branch field mandatory
Instead of having an arbitrary default branch, make the checkout
branch mandatory. This needed a little finessing in the tests, since
they did not cover using different branches (though did cover using a
non-standard branch).

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-01-05 11:33:52 +00:00
Michael Bridgen 825645d0d6
Merge pull request #73 from fluxcd/ignore-charts-etc
Screen files, and output only those updated
2021-01-05 10:06:26 +00: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
Michael Bridgen 8894a7e34d
Merge pull request #67 from fluxcd/readme-example
Correct example given in README
2020-12-10 14:23:58 +00:00
Michael Bridgen b78cebf42f Correct example given in README
- now requires an interval
 - .spec.update.setters.paths no longer there

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 14:18:54 +00:00
Michael Bridgen fbf5529e27
Merge pull request #65 from fluxcd/release-0.1.0
Release 0.1.0 preparation
2020-12-10 13:59:37 +00:00
Michael Bridgen 2a11609e97 Pin image-reflector API to v0.1.0
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 13:32:43 +00:00
Michael Bridgen 45219cb4d7 Pin deployment version to v0.1.0
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 13:32:43 +00:00
Michael Bridgen fec80515b2 Bump toolkit CRDs used
This also corrects a defect in the Makefile: if it can't fetch the
CRDs successfully, it should fail. (Otherwise, it just write the 404
resopnse body to the expected-CRD file!)

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 13:32:43 +00:00
Michael Bridgen 5649927ef7 Bump GOTK packages
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 13:32:43 +00:00
Michael Bridgen c928f87ab4 Start changelog
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-10 13:32:43 +00:00
Michael Bridgen ede45eb0e7
Merge pull request #64 from fluxcd/remove-paths-for-now
Remove paths field from update.setters
2020-12-09 12:36:02 +00:00
Michael Bridgen 9a4fe520c6 Remove paths field from update.setters
The paths field in update.setters is to restrict the update to files
in particular paths.

But this is not implemented, and although it sounds useful, it's not
clear it's necessary. Until there's a known problem to be solved by
it, I'm removing it.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-09 11:10:54 +00:00
Michael Bridgen a85ebbc72c
Merge pull request #63 from fluxcd/tidies
Minor tidies
2020-12-08 13:20:54 +00:00
Michael Bridgen 7227dd00ff Line up $IMG in Makefile with convention
This changes the value of $IMG in the Makefile to line up with other
GitOps toolkit controllers. The main effect is the the `kustomize edit
image` commands used in the deploy and dev-deploy targets will now set
the image tag, rather than let it stay at whatever the last release
was.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-08 10:17:47 +00:00
Michael Bridgen 4f9da74121 Tidy stray println and misleading comments
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-08 10:17:27 +00:00
Michael Bridgen 38671db816
Merge pull request #62 from fluxcd/runinterval-interval
RunInterval -> Interval
2020-12-07 15:29:49 +00:00
Michael Bridgen 5b4e93ebe4 Define const for ImageUpdateAutomation kind
This is handy for the CLI, among other places.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-07 14:59:25 +00:00
Michael Bridgen c069305a42 Change optional RunInterval to required Interval
This is to line up better with the other GitOps Toolkit API types.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-07 14:58:13 +00:00
Michael Bridgen 32380fb9a6
Merge pull request #60 from fluxcd/metricals-probes
Metrics and notifications
2020-12-03 11:06:24 +00:00
Michael Bridgen 64177cc6f5 Send notifications too when emitting events
This adds the external event recorder (a.k.a., notifications client)
to the reconciler, and expands the definition of
`<reconciler>.event(...)` so that it will send a notification whenever
an event is emitted. This is the conventional way of handling events
amongst the GitOps Toolkit controllers.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-01 11:37:23 +00:00
Michael Bridgen 31f1e62cd4 Use probes installer from fluxcd/pkg
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-01 11:28:06 +00:00
Michael Bridgen 16e810a123 Record metrics for readiness and duration
Using the conventions of the day.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-12-01 11:08:29 +00:00
Michael Bridgen 027370a62f
Merge pull request #55 from fluxcd/suspect-and-force
Suspend and force mechanisms
2020-12-01 09:46:34 +00:00
Michael Bridgen 7d816f3e69 Exit without updating status if suspended
The convention is now to simply exit, when a GOTK object is
suspended. Previously this would update the status to indicate that it
was unready; now it just leaves it in whichever state it was before.

This also applies to the reconcile request annotation; it will _not_
be marked as seen if the object is suspended. The effect of this is
any change to the object will be passed by the predicate and therefore
reach Reconcile, until the object is unsuspended. Since it will _also_
exit early until unsuspended, this is harmless except for some extra
log lines. (But changing that ordering might be worth considering in
the future.)

This change required a few changes to tests:

 - to check that suspend makes the reconciliation exit without doing
   anything, explicitly run `r.Reconcile(...)`.

 - to avoid waiting for the reconciler's caching client to see
   changes, use an uncached client.

 - (fix a problem caused by comparing a time pointer with its alias)

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 15:15:34 +00:00
Michael Bridgen a582871a79 Make sure reconcile request annotation works
The convention among GOTK controllers is to use a "reconcile request"
annotation to force a reconcilation, outside of spec or dependency
changes. This is used by e.g., the incoming webhooks handler. The
predicate `ChangePredicate`, already used by this controller, takes
this into account by allowing events that either caused the generation
to increment, _or_ changed the reconcile request annotation.

This commit adds a test that the automation will indeed run when the
annotation is set. This is a little delicate, because I have to rule
out _other_ reasons it might run. To do so, the test makes a change to
the git repo that will be overwritten by an automation run -- a commit
will not trigger a Reconcile call since it's entirely outside
Kubernetes.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 15:15:34 +00:00
Michael Bridgen 8bc349d4e2 Implement and test Suspend in controller
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 15:15:34 +00:00
Michael Bridgen 5cac345a43 Add Suspend field to spec
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 15:15:34 +00:00
Michael Bridgen 0b4914aa4b
Merge pull request #58 from fluxcd/generate-api-docs
Generate API docs
2020-11-30 15:13:37 +00:00
Michael Bridgen 0cf879abd2 Add generated API docs
Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 14:19:55 +00:00
Michael Bridgen a036d00db1 Add target for API docs generation to Makefile
This adapts the API docs generation, minimally, from
kustomize-controller to work here.

Signed-off-by: Michael Bridgen <michael@weave.works>
2020-11-30 14:17:03 +00:00
Stefan Prodan fdafff5515
Merge pull request #57 from valeriano-manassero/patch-1
Fix kustomize build references on README
2020-11-30 15:11:48 +02:00