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(kube-api-rewriter): add AdmissionReview response patch rewriter #180

Conversation

diafour
Copy link
Member

@diafour diafour commented Jul 3, 2024

Description

  • Rewrite metadata in patches for mutating responses.
  • Move admission request test to admission_review_test.go.
  • Add webhookRules to createTestRewriter.

Why do we need it, and what problem does it solve?

Mutating webhook sets original label "kubevirt.io/vmi-name=vmi-name" to the InternalVirtualizationVirtualMachineInstanceMigration. virt-controller lost this resource, since labelSelector in watch is rewritten.

What is the expected result?

Migration works for VMs.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Isteb4k
Isteb4k previously approved these changes Jul 3, 2024
yaroslavborbat
yaroslavborbat previously approved these changes Jul 4, 2024
@diafour diafour dismissed stale reviews from yaroslavborbat and Isteb4k via 0ffbf2b July 4, 2024 10:47
- Rewrite metadata in patches for mutating responses.
- Full restore for object and oldObject in AdmisstionReview request.
- Move admission request test to admission_review_test.go.
- Add webhookRules to createTestRewriter.
- Allow rewrite for JSON responses for non application/json Content-Type. E.g. text/plain responses from webhooks.

Signed-off-by: Ivan Mikheykin <[email protected]>
@diafour diafour force-pushed the refactor/kube-api-rewriter/admission-response-rewrite-metadata-patch branch from 0ffbf2b to 83b43f3 Compare July 4, 2024 11:42
Signed-off-by: Ivan Mikheykin <[email protected]>
@fl64 fl64 merged commit 8f7557b into main Jul 4, 2024
10 checks passed
@fl64 fl64 deleted the refactor/kube-api-rewriter/admission-response-rewrite-metadata-patch branch July 4, 2024 15:11
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.

4 participants