Skip to content

Commit e7ece82

Browse files
committed
fix: disable Talos >= 1.10 for now as Omni isn't ready for it yet
Kernel args were constant in Talos before UKI support, so Omni drops them by default when generating/rebuilding schematics. So if the Machines are upgraded to 1.10 and switch to UKI, they will be disconnected from Omni. Do not allow using Talos 1.10, until we introduce proper support for the UKI non-secureboot machines. Signed-off-by: Artem Chernyshev <[email protected]>
1 parent 2606693 commit e7ece82

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

internal/backend/runtime/omni/controllers/omni/versions.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,7 @@ func (ctrl *VersionsController) reconcileTalosVersions(ctx context.Context, r co
247247
talosVersions := ctrl.getVersionsAfter(allVersions, minDiscoveredTalosVersion, config.Config.EnableTalosPreReleaseVersions)
248248

249249
talosVersions = xslices.FilterInPlace(talosVersions, func(v string) bool {
250-
_, denylisted := consts.DenylistedTalosVersions[v]
251-
252-
return !denylisted
250+
return consts.DenylistedTalosVersions.IsAllowed(v)
253251
})
254252

255253
err = forAllCompatibleVersions(talosVersions, k8sVersions, func(talosVer string, compatibleK8sVersions []string) error {

internal/pkg/constants/versions.go

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
package constants
77

8+
import (
9+
"fmt"
10+
11+
"github.com/blang/semver/v4"
12+
)
13+
814
// AnotherTalosVersion is used in the integration tests for Talos upgrade.
915
const AnotherTalosVersion = "1.9.0"
1016

@@ -26,7 +32,31 @@ const AnotherKubernetesVersion = "1.31.7"
2632
const MinKubernetesVersion = "1.24.0"
2733

2834
// DenylistedTalosVersions is a list of versions which should never show up in the version picker.
29-
var DenylistedTalosVersions = map[string]struct{}{
30-
"1.4.2": {}, // issue with the number of open files limit
31-
"1.4.3": {}, // issue with the number of open files limit
35+
var DenylistedTalosVersions = Denylist{
36+
"1.4.2": {}, // issue with the number of open files limit
37+
"1.4.3": {}, // issue with the number of open files limit
38+
"1.10.*": {}, // Omni is not ready for 1.10.x yet
39+
}
40+
41+
// Denylist helper.
42+
type Denylist map[string]struct{}
43+
44+
// IsAllowed checks if the version of Talos is allowed.
45+
func (d Denylist) IsAllowed(version string) bool {
46+
if _, ok := d[version]; ok {
47+
return false
48+
}
49+
50+
ver, err := semver.ParseTolerant(version)
51+
if err != nil {
52+
return false
53+
}
54+
55+
pattern := fmt.Sprintf("%d.%d.*", ver.Major, ver.Minor)
56+
57+
if _, ok := d[pattern]; ok {
58+
return false
59+
}
60+
61+
return true
3262
}

0 commit comments

Comments
 (0)