Commit Graph

16 Commits

Author SHA1 Message Date
Michael Bridgen 155f6e948d Be consistent about returning an error
It's mooted in https://github.com/fluxcd/toolkit/discussions/164 that
a distinct metric is used for not completing reconciliation, as
opposed to an unexpected error. Until that discussion has run its
course, we should just do what the other controllers do, and that's
returning an error when the controller is unable to reconcile to
completion.

This also adds a comment noting the purpose of the redundant `Requeue:
true` fields, for the avoidance of confusion later.
2020-08-20 14:45:43 +01:00
stefanprodan 4a546eb97c Add image URL invalid reason 2020-08-15 08:38:57 +03:00
stefanprodan d966c16a06 Implement Ready condition for image repos 2020-08-12 16:38:43 +03:00
stefanprodan 0df16f7735 Configure events dispatching 2020-08-11 11:19:03 +03:00
stefanprodan 3c24b2dd43 Configure JSON logging 2020-08-11 09:04:02 +03:00
Michael Bridgen 6f46cbb331 Change go module and rewrite imports 2020-08-10 16:10:50 +01:00
Michael Bridgen f0991c829b Reassign copyright to Flux project 2020-08-10 16:07:09 +01:00
Hidde Beydals c590c94ec1 Change CRDs domain to 'image.toolkit.fluxcd.io' 2020-07-31 15:03:28 +02:00
Michael Bridgen 143d53dc32 Update module and imports 2020-07-18 15:12:14 +01:00
Michael Bridgen e0e1491970 Recalculate policy when a repository changes
This adds a watch for ImageRepository so that policies will be
recalculated when the repository is scanned.
2020-07-14 12:34:30 +01:00
Michael Bridgen a2b0bd4ed7 Calculate latest image for (semver) policy
This adds the details of calculating the latest image for a policy. It
relies on the ImageRepository and ImagePolicy controllers having a
shared database of image tags. Usually, this sort of thing would be
objects in the Kubernetes database; but since tags (and images) can
number in the tens of thousands per image, I'm using a separate
database. For the minute, it's just a map.
2020-07-14 12:34:30 +01:00
Michael Bridgen 6ae6561b8b Test that the tags for a repo are scanned
In this commit I use the test registry implementation to check that
the controller will scan the tags of an image. This needs a bit more
scaffolding, since the test registry doesn't handle /tags/list.
2020-07-12 14:08:16 +01:00
Michael Bridgen c9c5c4ad63 Actually scan the image repository
This commit adds a little code to scan the image repository given in
an ImageRepository resource, and report the (number of) tags there. It
does so anonymously, so it'll only work for public repos for the
minute.

The next step is to introduce ImagePolicy resources and figure out the
interaction with them -- e.g., if they only care about semver, you
might only need to get the tags.
2020-07-11 09:37:45 +01:00
Michael Bridgen 91c342d288 Jiggle things around until there's a passing test 2020-07-09 21:20:04 +01:00
Michael Bridgen 777ec34a86 Implement minimal ImageRepository spec
This adds an image name to the ImageRepository type, and resolves it
in the controller, just to show it doing something.
2020-07-08 22:13:35 +01:00
Michael Bridgen a628d482d5 Add ImageRepository type
kubebuilder create api --group image \
      --version v1alpha1 --kind ImageRepository
2020-07-08 07:49:00 +01:00