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>
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>
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>
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>
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>