Commit Graph

5 Commits

Author SHA1 Message Date
Sunny ae1f427625 PolicyFromSpec: return nil on error
Returning nil wrapped in Policy interface along with error returns an
interface with a nil value. This can't be used to perform a nil check.
To make it safe, return nil value on error.

Signed-off-by: Sunny <darkowlzz@protonmail.com>
2021-09-20 20:42:03 +05:30
Michael Bridgen 58e7a1539d Graduate v1alpha2 API to v1beta1
The schema is the same, which means this is a case of

 - copying over the type definitions;
 - changing the "stored" CRD version;
 - giving a CRD conversion of None, meaning just change the apiVersion;
 - using the new API package in the controller code;
 - moving the API docs to v1beta1

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-06-24 15:50:11 +01:00
Michael Bridgen ced5d88fe6 Move from v1alpha1 to v1alpha2 API
The image automation part of the API has changed structure (see [1]),
and had a version bump from `v1alpha1` to `v1alpha2`. Since the types
here are also in `image.toolkit.fluxcd.io`, there will be less
complication if they also get a version bump even though they aren't
changing.

[1] https://github.com/fluxcd/image-automation-controller/pull/139

Signed-off-by: Michael Bridgen <michael@weave.works>
2021-04-21 15:58:59 +02:00
Aurel Canciu 2def150710
Implement numerical ordering policy
Converts the given list of tags to floats and compares them based on the
ordering rule.
If a tag is not convertible, it will err and fail to compute the latest
version.

Fixes #102

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2021-02-11 13:06:50 +02:00
Aurel Canciu 9be3bc2325
Implement Alphabetical order policy
This implementation allows one to set a `MatchTagPrefix` to filter a
list of tags and/or use `Order` to set the ordering rule by which tags
are evaluated.

Signed-off-by: Aurel Canciu <aurelcanciu@gmail.com>
2020-12-09 21:02:42 +02:00