Moved missed condition.

This commit is contained in:
Michael Lipp 2025-03-05 10:24:40 +01:00
parent 7e650bf980
commit 7437a17c9f
2 changed files with 5 additions and 5 deletions

View file

@ -75,13 +75,13 @@ public class Constants {
/** The Constant ASSIGNMENT. */
public static final String ASSIGNMENT = "assignment";
/** The Constant COND_RUNNING. */
public static final String COND_RUNNING = "Running";
/**
* Conditions used in Status.
*/
public static class Condition {
/** The Constant COND_RUNNING. */
public static final String RUNNING = "Running";
/** The Constant COND_BOOTED. */
public static final String BOOTED = "Booted";

View file

@ -174,7 +174,7 @@ public class StatusUpdater extends VmDefUpdater {
}
status.getAsJsonArray("conditions").asList().stream()
.map(cond -> (JsonObject) cond)
.filter(cond -> Status.COND_RUNNING
.filter(cond -> Condition.RUNNING
.equals(cond.get("type").getAsString()))
.forEach(cond -> cond.addProperty("observedGeneration",
from.getMetadata().getGeneration()));
@ -200,7 +200,7 @@ public class StatusUpdater extends VmDefUpdater {
}
vmStub.updateStatus(from -> {
boolean running = event.runState().vmRunning();
updateCondition(vmDef, Status.COND_RUNNING, running, event.reason(),
updateCondition(vmDef, Condition.RUNNING, running, event.reason(),
event.message());
JsonObject status = updateCondition(vmDef, Condition.BOOTED,
event.runState() == RunState.BOOTED, event.reason(),