Skip to content

Commit 985a2d6

Browse files
committed
fix: node os version parsing
For OS'es that have versions starting with `v`, the parsing logic fails. Signed-off-by: Noel Georgi <git@frezbo.dev>
1 parent 652724d commit 985a2d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/state_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ func (n *ClusterPolicyController) getGPUNodeOSTag() (string, error) {
662662
return "", fmt.Errorf("unable to retrieve OS version from label %s", nfdOSVersionIDLabelKey)
663663
}
664664
osMajorVersion := strings.Split(osVersion, ".")[0]
665-
osMajorNumber, err := strconv.Atoi(osMajorVersion)
665+
osMajorNumber, err := strconv.Atoi(strings.TrimPrefix(osMajorVersion, "v"))
666666
if err != nil {
667667
return "", fmt.Errorf("error processing OS major version %s: %w", osMajorVersion, err)
668668
}

0 commit comments

Comments
 (0)