Still not working due to https://github.com/kubernetes-client/java/issues/3143.
This commit is contained in:
parent
6ef4c2aaa2
commit
3c2a327559
16 changed files with 56 additions and 48 deletions
|
|
@ -22,6 +22,7 @@ import com.google.gson.Gson;
|
|||
import freemarker.template.Configuration;
|
||||
import freemarker.template.TemplateException;
|
||||
import io.kubernetes.client.openapi.ApiException;
|
||||
import io.kubernetes.client.openapi.JSON;
|
||||
import io.kubernetes.client.openapi.models.V1APIService;
|
||||
import io.kubernetes.client.openapi.models.V1ObjectMeta;
|
||||
import io.kubernetes.client.util.generic.dynamic.DynamicKubernetesObject;
|
||||
|
|
@ -122,7 +123,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|||
? (Map<String, Map<String, String>>) lbsDef
|
||||
: null;
|
||||
var client = channel.client();
|
||||
mergeMetadata(client.getJSON().getGson(), svcDef, defaults, vmDef);
|
||||
mergeMetadata(JSON.getGson(), svcDef, defaults, vmDef);
|
||||
|
||||
// Apply
|
||||
var svcStub = K8sV1ServiceStub
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package org.jdrupes.vmoperator.manager;
|
|||
import com.google.gson.JsonObject;
|
||||
import io.kubernetes.client.apimachinery.GroupVersionKind;
|
||||
import io.kubernetes.client.openapi.ApiException;
|
||||
import io.kubernetes.client.openapi.JSON;
|
||||
import io.kubernetes.client.util.Watch;
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
|
@ -130,7 +131,7 @@ public class PoolMonitor extends
|
|||
|
||||
// Get pool and merge changes
|
||||
var vmPool = pools.computeIfAbsent(poolName, k -> new VmPool(poolName));
|
||||
vmPool.defineFrom(client().getJSON().getGson().fromJson(
|
||||
vmPool.defineFrom(JSON.getGson().fromJson(
|
||||
GsonPtr.to(poolModel.data()).to("spec").get(), VmPool.class));
|
||||
poolPipeline.fire(new VmPoolChanged(vmPool));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import freemarker.template.TemplateException;
|
|||
import freemarker.template.TemplateNotFoundException;
|
||||
import io.kubernetes.client.custom.V1Patch;
|
||||
import io.kubernetes.client.openapi.ApiException;
|
||||
import io.kubernetes.client.openapi.JSON;
|
||||
import io.kubernetes.client.util.generic.dynamic.Dynamics;
|
||||
import io.kubernetes.client.util.generic.options.ListOptions;
|
||||
import io.kubernetes.client.util.generic.options.PatchOptions;
|
||||
|
|
@ -160,8 +161,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|||
opts.setForce(true);
|
||||
opts.setFieldManager("kubernetes-java-kubectl-apply");
|
||||
if (pvcStub.patch(V1Patch.PATCH_FORMAT_APPLY_YAML,
|
||||
new V1Patch(channel.client().getJSON().serialize(pvcDef)), opts)
|
||||
.isEmpty()) {
|
||||
new V1Patch(JSON.serialize(pvcDef)), opts).isEmpty()) {
|
||||
logger.warning(
|
||||
() -> "Could not patch pvc for " + pvcStub.name());
|
||||
}
|
||||
|
|
@ -203,8 +203,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|||
opts.setForce(true);
|
||||
opts.setFieldManager("kubernetes-java-kubectl-apply");
|
||||
if (pvcStub.patch(V1Patch.PATCH_FORMAT_APPLY_YAML,
|
||||
new V1Patch(channel.client().getJSON().serialize(pvcDef)), opts)
|
||||
.isEmpty()) {
|
||||
new V1Patch(JSON.serialize(pvcDef)), opts).isEmpty()) {
|
||||
logger.warning(
|
||||
() -> "Could not patch pvc for " + pvcStub.name());
|
||||
}
|
||||
|
|
@ -218,8 +217,7 @@ import org.yaml.snakeyaml.constructor.SafeConstructor;
|
|||
PatchOptions opts = new PatchOptions();
|
||||
opts.setFieldManager("kubernetes-java-kubectl-apply");
|
||||
if (pvcStub.patch(V1Patch.PATCH_FORMAT_JSON_MERGE_PATCH,
|
||||
new V1Patch(channel.client().getJSON().serialize(pvcDef)), opts)
|
||||
.isEmpty()) {
|
||||
new V1Patch(JSON.serialize(pvcDef)), opts).isEmpty()) {
|
||||
logger.warning(
|
||||
() -> "Could not patch pvc for " + pvcStub.name());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue