Refactor internal Kubernetes API and upgrade to official v19 (#19)
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
Michael N. Lipp 2024-03-14 20:12:37 +01:00 committed by GitHub
parent ee2de96c56
commit a2641da7f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 2343 additions and 395 deletions

View file

@ -18,8 +18,8 @@
package org.jdrupes.vmoperator.manager.events;
import io.kubernetes.client.openapi.ApiClient;
import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject;
import org.jdrupes.vmoperator.common.K8sClient;
import org.jdrupes.vmoperator.common.K8sDynamicModel;
import org.jgrapes.core.Channel;
import org.jgrapes.core.EventPipeline;
import org.jgrapes.core.Subchannel.DefaultSubchannel;
@ -31,8 +31,8 @@ import org.jgrapes.core.Subchannel.DefaultSubchannel;
public class VmChannel extends DefaultSubchannel {
private final EventPipeline pipeline;
private final ApiClient client;
private DynamicKubernetesObject vmDefinition;
private final K8sClient client;
private K8sDynamicModel vmDefinition;
private long generation = -1;
/**
@ -43,7 +43,7 @@ public class VmChannel extends DefaultSubchannel {
* @param client the client
*/
public VmChannel(Channel mainChannel, EventPipeline pipeline,
ApiClient client) {
K8sClient client) {
super(mainChannel);
this.pipeline = pipeline;
this.client = client;
@ -56,7 +56,7 @@ public class VmChannel extends DefaultSubchannel {
* @return the watch channel
*/
@SuppressWarnings("PMD.LinguisticNaming")
public VmChannel setVmDefinition(DynamicKubernetesObject definition) {
public VmChannel setVmDefinition(K8sDynamicModel definition) {
this.vmDefinition = definition;
return this;
}
@ -66,7 +66,7 @@ public class VmChannel extends DefaultSubchannel {
*
* @return the json object
*/
public DynamicKubernetesObject vmDefinition() {
public K8sDynamicModel vmDefinition() {
return vmDefinition;
}
@ -109,7 +109,7 @@ public class VmChannel extends DefaultSubchannel {
*
* @return the API client
*/
public ApiClient client() {
public K8sClient client() {
return client;
}
}

View file

@ -19,7 +19,7 @@
package org.jdrupes.vmoperator.manager.events;
import io.kubernetes.client.openapi.models.V1APIResource;
import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject;
import org.jdrupes.vmoperator.common.K8sDynamicModel;
import org.jgrapes.core.Channel;
import org.jgrapes.core.Components;
import org.jgrapes.core.Event;
@ -44,7 +44,7 @@ public class VmDefChanged extends Event<Void> {
private final Type type;
private final boolean specChanged;
private final V1APIResource crd;
private final DynamicKubernetesObject vmDef;
private final K8sDynamicModel vmDef;
/**
* Instantiates a new VM changed event.
@ -55,7 +55,7 @@ public class VmDefChanged extends Event<Void> {
* @param vmDefinition the VM definition
*/
public VmDefChanged(Type type, boolean specChanged, V1APIResource crd,
DynamicKubernetesObject vmDefinition) {
K8sDynamicModel vmDefinition) {
this.type = type;
this.specChanged = specChanged;
this.crd = crd;
@ -92,7 +92,7 @@ public class VmDefChanged extends Event<Void> {
*
* @return the object.
*/
public DynamicKubernetesObject vmDefinition() {
public K8sDynamicModel vmDefinition() {
return vmDef;
}