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 admissionRequest in ctx #2718

Closed
wants to merge 4 commits into from
Closed

Conversation

rahulii
Copy link
Contributor

@rahulii rahulii commented Apr 7, 2023

Changes

  • 🧹 This PR associated the admissionv1.AdmissionRequest object the webhook received with the context.
  • adds a unit test

/kind

Fixes #2656

Release Note

Docs

@knative-prow
Copy link

knative-prow bot commented Apr 7, 2023

@rahulii: The label(s) kind/<kind> cannot be applied, because the repository doesn't have them.

In response to this:

Changes

  • 🧹 This PR associated the admissionv1.AdmissionRequest object the webhook received with the context.
  • adds a unit test

/kind

Fixes #2656

Release Note

Docs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot requested review from aslom and psschwei April 7, 2023 10:36
@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 7, 2023
@knative-prow
Copy link

knative-prow bot commented Apr 7, 2023

Hi @rahulii. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 🎉

Comparison is base (696cac8) 81.45% compared to head (4872e40) 81.47%.

❗ Current head 4872e40 differs from pull request most recent head 4c8ae8b. Consider uploading reports for the commit 4c8ae8b to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2718      +/-   ##
==========================================
+ Coverage   81.45%   81.47%   +0.02%     
==========================================
  Files         163      163              
  Lines        9932     9946      +14     
==========================================
+ Hits         8090     8104      +14     
  Misses       1598     1598              
  Partials      244      244              
Impacted Files Coverage Δ
apis/contexts.go 100.00% <100.00%> (ø)

... and 6 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

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

We should remove the HTTP request from the context in favour of the AdmissionRequest

apis/contexts.go Outdated Show resolved Hide resolved
@rahulii
Copy link
Contributor Author

rahulii commented Apr 11, 2023

We should remove the HTTP request from the context in favour of the AdmissionRequest

https://github.com/knative/pkg/blob/main/webhook/conversion.go#L59
conversion webhook also uses this function - we would not be able to remove it I guess unless we also support Request *ConversionRequest

@knative-prow
Copy link

knative-prow bot commented Apr 11, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rahulii
Once this PR has been reviewed and has the lgtm label, please ask for approval from dprotaso. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@dprotaso
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 11, 2023
@knative-prow
Copy link

knative-prow bot commented Apr 11, 2023

@rahulii: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
unit-tests_pkg_main 4c8ae8b link true /test unit-tests

Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@dprotaso
Copy link
Member

conversion webhook also uses this function - we would not be able to remove it I guess unless we also support Request *ConversionRequest

Yeah let's do that and add helpers for ConversionReview

@github-actions
Copy link
Contributor

This Pull Request is stale because it has been open for 90 days with
no activity. It will automatically close after 30 more days of
inactivity. Reopen with /reopen. Mark as fresh by adding the
comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 12, 2023
@krsna-m krsna-m closed this Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider putting the admission review on the webhook context
3 participants