Closed vromero closed 3 years ago
FYI @aelsabbahy @pedroMMM
I am interested in this solution too. We need to test the OS kernel versions to be at least greater than some semver.
more: https://github.com/kubernetes-sigs/image-builder/pull/472
cc: @sanikagawhane
I am sorry everyone I haven't been paying attention to OSS since under my current contract I can't contribute code (gaming industry quirks).
@vromero I found your issue. semverConstraint
isn't the custom matcher, the custom matcher is semver-constraint
. But custom matchers don't function inside the template language, lucky we integrated Sprig Template Functions which comes with its own function for SemVer. With this I was able to replicate your use case by using:
file:
{{ if .Env.VERSION | semverCompare ">=1.5.3" }}
/some/file:
exists: true
{{ end }}
@EleanorRigby I am sure of the technical reason but you can't use the matchers on the command
, @aelsabbahy can you explain the details and/or give some alternative.
@pedroMMM thanks a lot! This is super useful. Also thanks for your original PR, even if I end upusing Sprig, your contribution to OSS is very appretiated.
After the fix of #355 (thanks!) I was expecting to be able to convert something like this:
to something like this
But either the current implementation only matches packages or I just don't get it.
Is this filter I'm trying to apply something actually possible?
Thanks