virtualization icon indicating copy to clipboard operation
virtualization copied to clipboard

refactor(core): prevent not found error from kubectl

Open diafour opened this issue 1 year ago • 1 comments

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.

diafour avatar Sep 12 '24 07:09 diafour

Status field of VMI should not be a subresource. kubevirt updates status field as a part of "main" payload.

diafour avatar Sep 12 '24 12:09 diafour