feat: add multidoc check to the Talos quirks module

Make it report true for Talos >= 1.5.0.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
This commit is contained in:
Artem Chernyshev 2024-05-29 17:44:14 +03:00
parent 0b4a9777fc
commit 4feb94ca09
No known key found for this signature in database
GPG Key ID: E084A2DF1143C14D

View File

@ -74,3 +74,15 @@ func (q Quirks) UseZSTDCompression() bool {
return q.v.GTE(minVersionZstd) return q.v.GTE(minVersionZstd)
} }
var minVersionMultidoc = semver.MustParse("1.5.0")
// SupportsMultidoc returns true if the Talos version supports multidoc machine configs.
func (q Quirks) SupportsMultidoc() bool {
// if the version doesn't parse, we assume it's latest Talos
if q.v == nil {
return true
}
return q.v.GTE(minVersionMultidoc)
}