Home > Enterprise >  Kubernetes job creation method showing as deprecated in IntelliJ. I am using Fabric8 Kubernetes Clie
Kubernetes job creation method showing as deprecated in IntelliJ. I am using Fabric8 Kubernetes Clie

Time:10-22

I am using Fabric8 Kubernetes Client library to for Java to create Kubernetes job, but the create method is shown as deprecated. I checked all the available docs and I don't see that its deprecated but IntelliJ IDE is showing as deprecated.

While searching for solution, I found out this link enter image description here

Kindly guide me how can I fix this deprecation issue.

CodePudding user response:

Since Fabric8 v6, we've introduced a new resource(T item) DSL method which recieves the resource which is supposed to be operated on. You should be able to access all operations from here.

So, you need to change your code to this:

Job job2 = client.batch().v1().jobs().inNamespace("default").resource(job).create();

You can read more about this in Fabric8 v6 Migration guide.

  • Related