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

Refactor read and write functions for new handlers #21

Merged
merged 2 commits into from
Jun 9, 2022

Conversation

klaases
Copy link
Contributor

@klaases klaases commented Apr 14, 2022

In this PR, our goal is to refactor code that is reusable between webhook handlers. We can reuse the code that is needed to read the incoming request, as well as provided the required responses, especially for errors.

  • /mutate
  • /mutate/sa
  • /mutate/ns (coming soon!)

Specifically, we are going to be adding another handler for new namespaces. We want to make sure everything is working as intended before hand. Without refactoring we would have to duplicate code between handlers up to 3x.

@google-cla
Copy link

google-cla bot commented Apr 14, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

@klaases klaases marked this pull request as ready for review April 14, 2022 23:30
@klaases
Copy link
Contributor Author

klaases commented Apr 14, 2022

/assign

@klaases
Copy link
Contributor Author

klaases commented Apr 14, 2022

I have signed the CLA - good to go!

@sharifelgamal sharifelgamal merged commit 7161fa8 into GoogleContainerTools:main Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants