Using fabric8 API to check kubernetes cron jobs

1/11/2019

I'm trying to create a java test to check the status of cron jobs on a kubernetes, however I'm having trouble with the fabric8 imports.

I've tried

    import io.fabric8.kubernetes.api.model.batch.Job;
    import io.fabric8.kubernetes.api.model.batch.JobList;

However this throws an error. For some reason, java cannot resolve the 'batch' symbol. This tells me there is probably something missing in my ivy.xml dependencies.

I have the following dependencies already in my ivy.xml

    <dependency org="io.fabric8" name="kubernetes-client" rev="3.1.12"/>
    <dependency org="io.fabric8" name="kubernetes-api" rev="2.0.9"/>
    <dependency org="io.fabric8" name="kubernetes-model" rev="3.1.12"/>

Am I missing a dependency? Or is there another problem?

-- Alex Parker
fabric8
ivy
java
kubernetes

1 Answer

1/18/2019

The problem was the dependencies were out of date.

The dependency for JobList wasn't added until several versions later. Apparently, nobody on our team has updated those dependencies in our ivy file for almost a year.

In other words, to avoid issues like this, one should always keep there dependencies up to date.

-- Alex Parker
Source: StackOverflow