You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: rollback mechanism virtualservice patch in model endpoint (#655)
# Description
When creating/patching/deleting VirtualService for model endpoint
related action, if there's any error happened after the action is
successfully run, there's a possibility of mismatch state between the
resource state in Kubernetes vs what is being recorded in database (as
this will not be updated).
# Modifications
Changes:
- Add `GetVirtualService` function to get the current state of
VirtualService
- Add `cleanVirtualServiceFields` function to remove not-needed field
when creating or patching resource, e.g. UUID or generation number, if
this isn't set to empty/default, the Patch/Create will not succeed
- Flow, if there's any error occur after the create/patching/delete
happened, rollback the changes in Kubernetes to previous state
- Create -> remove the newly created VirtualService
- Patch -> re-patch the VirtualService to previous state
- Delete -> recreate the VirtualService if previously there's an
existing one
# Tests
<!-- Besides the existing / updated automated tests, what specific
scenarios should be tested? Consider the backward compatibility of the
changes, whether corner cases are covered, etc. Please describe the
tests and check the ones that have been completed. Eg:
- [x] Deploying new and existing standard models
- [ ] Deploying PyFunc models
-->
# Checklist
- [x] Added PR label
- [x] Added unit test, integration, and/or e2e tests
- [x] Tested locally
- [ ] Updated documentation
- [ ] Update Swagger spec if the PR introduce API changes
- [ ] Regenerated Golang and Python client if the PR introduces API
changes
# Release Notes
```release-note
NONE
```
0 commit comments