mirror of https://github.com/kubernetes/kops.git
Update with static check suggestions
This commit is contained in:
parent
1fea54bc3c
commit
2317b77ba5
|
|
@ -642,7 +642,7 @@ func validateCalicoAutoDetectionMethod(fldPath *field.Path, runtime *string, ver
|
||||||
|
|
||||||
} else if strings.HasPrefix(*runtime, methodInterface) {
|
} else if strings.HasPrefix(*runtime, methodInterface) {
|
||||||
ifStr := strings.TrimPrefix(*runtime, methodInterface)
|
ifStr := strings.TrimPrefix(*runtime, methodInterface)
|
||||||
ifRegexes := regexp.MustCompile("\\s*,\\s*").Split(ifStr, -1)
|
ifRegexes := regexp.MustCompile(`\s*,\s*`).Split(ifStr, -1)
|
||||||
if len(ifRegexes) == 0 || ifRegexes[0] == "" {
|
if len(ifRegexes) == 0 || ifRegexes[0] == "" {
|
||||||
validationError = append(validationError, field.Invalid(fldPath, runtime, "Expected 'interface=<COMMA-SEPARATED-LIST>'"))
|
validationError = append(validationError, field.Invalid(fldPath, runtime, "Expected 'interface=<COMMA-SEPARATED-LIST>'"))
|
||||||
}
|
}
|
||||||
|
|
@ -656,7 +656,7 @@ func validateCalicoAutoDetectionMethod(fldPath *field.Path, runtime *string, ver
|
||||||
|
|
||||||
} else if strings.HasPrefix(*runtime, methodSkipInterface) {
|
} else if strings.HasPrefix(*runtime, methodSkipInterface) {
|
||||||
ifStr := strings.TrimPrefix(*runtime, methodSkipInterface)
|
ifStr := strings.TrimPrefix(*runtime, methodSkipInterface)
|
||||||
ifRegexes := regexp.MustCompile("\\s*,\\s*").Split(ifStr, -1)
|
ifRegexes := regexp.MustCompile(`\s*,\s*`).Split(ifStr, -1)
|
||||||
if len(ifRegexes) == 0 || ifRegexes[0] == "" {
|
if len(ifRegexes) == 0 || ifRegexes[0] == "" {
|
||||||
validationError = append(validationError, field.Invalid(fldPath, runtime, "Expected 'skip-interface=<COMMA-SEPARATED-LIST>'"))
|
validationError = append(validationError, field.Invalid(fldPath, runtime, "Expected 'skip-interface=<COMMA-SEPARATED-LIST>'"))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue