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 profile binding unit tests #402

Merged

Conversation

saschagrunert
Copy link
Member

What type of PR is this?

/kind bug

What this PR does / why we need it:

Adding unit test cases to the binding webhook.

This also fixes a bug where the binding error did not get returned
correctly which would cause the webhook to crash.

Which issue(s) this PR fixes:

None

Does this PR have test?

Yes

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

None

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 15, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 15, 2021
@@ -173,7 +173,7 @@ func (p *podSeccompBinder) getSeccompProfile(
err = util.Retry(
func() (retryErr error) {
seccompProfile, retryErr = p.GetSeccompProfile(ctx, key)
if err != nil {
if retryErr != nil {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, that's a bug.

Adding unit test cases to the binding webhook.

This also fixes a bug where the binding error did not get returned
correctly which would cause the webhook to crash.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
@codecov-io
Copy link

Codecov Report

Merging #402 (da41677) into master (c43de04) will increase coverage by 7.70%.
The diff coverage is 100.00%.

❗ Current head da41677 differs from pull request most recent head 09e51b7. Consider uploading reports for the commit 09e51b7 to get more accurate results

@@            Coverage Diff             @@
##           master     #402      +/-   ##
==========================================
+ Coverage   30.37%   38.08%   +7.70%     
==========================================
  Files          20       20              
  Lines         948      948              
==========================================
+ Hits          288      361      +73     
+ Misses        650      572      -78     
- Partials       10       15       +5     

@JAORMX
Copy link
Contributor

JAORMX commented Apr 15, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2021
@k8s-ci-robot k8s-ci-robot merged commit 17ed5ac into kubernetes-sigs:master Apr 15, 2021
@saschagrunert saschagrunert deleted the binding-unit-tests branch April 15, 2021 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants