summaryrefslogtreecommitdiff
path: root/pkg/util/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/util/utils.go')
-rw-r--r--pkg/util/utils.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go
index 774590f44..63fad0286 100644
--- a/pkg/util/utils.go
+++ b/pkg/util/utils.go
@@ -618,6 +618,12 @@ func ValidateSysctls(strSlice []string) (map[string]string, error) {
if len(arr) < 2 {
return nil, errors.Errorf("%s is invalid, sysctl values must be in the form of KEY=VALUE", val)
}
+
+ trimmed := fmt.Sprintf("%s=%s", strings.TrimSpace(arr[0]), strings.TrimSpace(arr[1]))
+ if trimmed != val {
+ return nil, errors.Errorf("'%s' is invalid, extra spaces found", val)
+ }
+
if validSysctlMap[arr[0]] {
sysctl[arr[0]] = arr[1]
continue