Merge pull request #106875 from warmchang/flag-cleanup

cleanup(apiserver): Correct the error message to not use the "--max-resource-write-bytes" & "--json-patch-max-copy-bytes" string.
This commit is contained in:
Kubernetes Prow Robot 2022-01-03 08:37:00 -08:00 committed by GitHub
commit 2cd8ceb269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -151,11 +151,11 @@ func (s *ServerRunOptions) Validate() []error {
}
if s.JSONPatchMaxCopyBytes < 0 {
errors = append(errors, fmt.Errorf("--json-patch-max-copy-bytes can not be negative value"))
errors = append(errors, fmt.Errorf("ServerRunOptions.JSONPatchMaxCopyBytes can not be negative value"))
}
if s.MaxRequestBodyBytes < 0 {
errors = append(errors, fmt.Errorf("--max-resource-write-bytes can not be negative value"))
errors = append(errors, fmt.Errorf("ServerRunOptions.MaxRequestBodyBytes can not be negative value"))
}
if err := validateHSTSDirectives(s.HSTSDirectives); err != nil {

View File

@ -99,7 +99,7 @@ func TestServerRunOptionsValidate(t *testing.T) {
JSONPatchMaxCopyBytes: -10 * 1024 * 1024,
MaxRequestBodyBytes: 10 * 1024 * 1024,
},
expectErr: "--json-patch-max-copy-bytes can not be negative value",
expectErr: "ServerRunOptions.JSONPatchMaxCopyBytes can not be negative value",
},
{
name: "Test when MaxRequestBodyBytes is negative value",
@ -113,7 +113,7 @@ func TestServerRunOptionsValidate(t *testing.T) {
JSONPatchMaxCopyBytes: 10 * 1024 * 1024,
MaxRequestBodyBytes: -10 * 1024 * 1024,
},
expectErr: "--max-resource-write-bytes can not be negative value",
expectErr: "ServerRunOptions.MaxRequestBodyBytes can not be negative value",
},
{
name: "Test when LivezGracePeriod is negative value",