-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more negative test cases for backend config #383
Conversation
}, | ||
backendConfig: fuzz.NewBackendConfigBuilder("", "backendconfig-1"). | ||
EnableCDN(true). | ||
SetIAPConfig(true, "bar"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how the code is written, you will actually have to create the secret "bar". Otherwise, it will return an error saying the secret does not exist, rather than the error we actually are testing for,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I'm seeing this:
Error during sync: error while evaluating the ingress spec: BackendConfig test-sandbox-48912bf33631f0fe/backendconfig-1 is not valid: error retrieving secret bar: secrets \"bar\" not found
Added the logic to actually create the secret "bar".
@@ -95,7 +94,7 @@ func GetBackendConfigForServicePort(backendConfigLister cache.Store, svc *apiv1. | |||
if err == annotations.ErrBackendConfigAnnotationMissing { | |||
return nil, nil | |||
} | |||
return nil, ErrBackendConfigsFromAnnotation | |||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for the change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was meant to make the warning event more useful. Without this change, when annotation is in invalid format, user will see something like "error getting backend config" instead of "the annotation is invalid".
/lgtm |
Cherrypick #383: Unmask get backend config errors
/assign @rramkumar1 @bowei