1
0
Fork 0
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:
Kubernetes Prow Robot 2020-05-17 03:05:36 -07:00 committed by GitHub
commit 1465da4cdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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