mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #309 from paroque28/replace
Proposal kernel.go: Replace forbidden symbols and check format
This commit is contained in:
commit
1465da4cdc
1 changed files with 5 additions and 0 deletions
|
@ -97,6 +97,11 @@ func parseVersion() (map[string]string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
full := strings.TrimSpace(string(raw))
|
full := strings.TrimSpace(string(raw))
|
||||||
|
|
||||||
|
// Replace forbidden symbols
|
||||||
|
fullRegex := regexp.MustCompile("[^-A-Za-z0-9_.]")
|
||||||
|
full = fullRegex.ReplaceAllString(full, "_")
|
||||||
|
|
||||||
version["full"] = full
|
version["full"] = full
|
||||||
|
|
||||||
// Regexp for parsing version components
|
// Regexp for parsing version components
|
||||||
|
|
Loading…
Reference in a new issue