mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-05 08:17:04 +00:00
kernel.go: Replace forbidden symbols
Some Kernel versions include symbols such as "+". Yocto L4T kernel is an example of this behaviour. To fix this error all unknown symbols are replaced by an underscore. Signed-off-by: Pablo Rodriguez <paroque28@gmail.com>
This commit is contained in:
parent
1bdf0525f9
commit
3c81ff9d80
1 changed files with 5 additions and 0 deletions
|
@ -97,6 +97,11 @@ func parseVersion() (map[string]string, error) {
|
|||
}
|
||||
|
||||
full := strings.TrimSpace(string(raw))
|
||||
|
||||
// Replace forbidden symbols
|
||||
fullRegex := regexp.MustCompile("[^-A-Za-z0-9_.]")
|
||||
full = fullRegex.ReplaceAllString(full, "_")
|
||||
|
||||
version["full"] = full
|
||||
|
||||
// Regexp for parsing version components
|
||||
|
|
Loading…
Add table
Reference in a new issue