Necessary changes.
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

Still not working due to
https://github.com/kubernetes-client/java/issues/3143.
This commit is contained in:
Michael Lipp 2025-04-14 14:05:23 +02:00
parent 6ef4c2aaa2
commit 3c2a327559
16 changed files with 56 additions and 48 deletions

View file

@ -71,7 +71,7 @@ import org.jgrapes.core.events.Start;
public class StatusUpdater extends VmDefUpdater {
@SuppressWarnings("PMD.FieldNamingConventions")
private static final Gson gson = new JSON().getGson();
private static final Gson gson = JSON.getGson();
@SuppressWarnings("PMD.FieldNamingConventions")
private static final ObjectMapper objectMapper
= new ObjectMapper().registerModule(new JavaTimeModule());

View file

@ -19,6 +19,7 @@
package org.jdrupes.vmoperator.runner.qemu;
import com.google.gson.JsonObject;
import io.kubernetes.client.openapi.JSON;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@ -161,8 +162,7 @@ public class VmDefUpdater extends Component {
: cond)
.collect(Collectors.toCollection(() -> new ArrayList<>()));
newConds.addAll(toReplace);
status.add("conditions",
apiClient.getJSON().getGson().toJsonTree(newConds));
status.add("conditions", JSON.getGson().toJsonTree(newConds));
return status;
}
}