UPGRADE FAILED with 'no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"'

I tried to upgrade my okteto chart version with Helm, but I am getting this error:

Error: UPGRADE FAILED: unable to build kubernetes objects from current release manifest: [resource mapping not found for name: "okteto-permissive" namespace: "" from "": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"
ensure CRDs are installed first, resource mapping not found for name: "okteto-restrictive" namespace: "" from "": no matches for kind "PodSecurityPolicy" in version "policy/v1beta1"
ensure CRDs are installed first]

what can I do to recover from this state?

To avoid this situation, you can upgrade your okteto chart version before upgrading Kubernetes to >= 1.25, adding this to your helm values file:

podSecurityPolicy:
   enabled: false

If you are already hitting this error, you can recover from it by deleteting all the secrets created by Helm to keep track of the okteto releases. Assuming okteto is the name of your release, you can delete these secrets by running:

kubectl -nokteto delete  secrets -l name=okteto,owner=helm

After this, you will be able to run a clean okteto install with helm install okteto ....
It’s important that you use the same release name when you install okteto with helm again.