spoved/kube-client.cr

Error Reading Job Status

Closed this issue · 3 comments

When attempting to watch a job for completion if you check the event.object.status.succeeded or .failed or .active vars you get a cast error.

unable to cast Int64 to Int32 | Nil (K8S::Kubernetes::Resource::Error::CastError) from usr/share/crystal/src/log/log.cr:36:3 in '__active' from app/lib/k8s/src/versions/v1.21/api/batch/v1/job_status.cr:8:1 in 'active' from app/src/controllers/plugin_controller.cr:149:28 in 'wait_for_job' from app/src/controllers/plugin_controller.cr:235:38 in 'handle_plugin_job' from app/src/controllers/plugin_controller.cr:216:9 in '->' from usr/share/crystal/src/fiber.cr:146:11 in 'run' from usr/share/crystal/src/fiber.cr:98:34 in '->'

What is the version of the k8s and kube_client are you using?

Sorry, been busy. I'm using version 1.21. I was able to find a workaround by using bracket notation ["succeeded"] and casting the result to an Int64 before comparison.

No worries, i think i resolved this in the latest release