Files
releases/internal/semver
Charlie Egan 8d321f0856 Add semver.compare & is_valid built-ins
These built-ins will allow policies to more easily make comparisons on
semantic version strings.

I am doing this because I recently needed to write policy concerning
versions of installed software in Kubernetes environments.

I feel this is a better solution than implementing such a feature in
Rego: https://gist.github.com/charlieegan3/76dbec05c65164ac98dfec74b1381c5a

is_valid is to allow users to gate access to the compare function which
fails if the input is not a valid version string.

The semver functionality is vendored from the coreos package based on
the discussion here:
https://github.com/open-policy-agent/opa/pull/2538#pullrequestreview-448422711

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
2020-07-15 16:06:14 -07:00
..