Skip to content
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

Merged
merged 3 commits into from
Jul 9, 2018

Conversation

MrHohn
Copy link
Member

@MrHohn MrHohn commented Jun 29, 2018

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 29, 2018
},
backendConfig: fuzz.NewBackendConfigBuilder("", "backendconfig-1").
EnableCDN(true).
SetIAPConfig(true, "bar").
Copy link
Contributor

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,

Copy link
Member Author

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
Copy link
Contributor

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?

Copy link
Member Author

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".

@rramkumar1
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 3, 2018
@MrHohn MrHohn merged commit 2683a0b into kubernetes:master Jul 9, 2018
freehan added a commit that referenced this pull request Jul 9, 2018
Cherrypick #383: Unmask get backend config errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants