virtualization
virtualization copied to clipboard
refactor(core): prevent not found error from kubectl
Description
- Add subresources status field.
- GET /apis/v1/.../resourcetype/NAME/status give error NotFound if no subresources field in CRD.
Why do we need it, and what problem does it solve?
Prevent errors from kubectl:
# kubectl -n NSNAME patch internalvirtualizationvirtualmachineinstance VMNAME --subresource status --type='json' --patch '[{"op": "remove","path": "/status/migrationState"}]'
Error from server (NotFound): internalvirtualizationvirtualmachineinstances.internal.virtualization.deckhouse.io "VMNAME" not found
What is the expected result?
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.
Status field of VMI should not be a subresource. kubevirt updates status field as a part of "main" payload.