Add runner version to status.
This commit is contained in:
parent
f0ebea5353
commit
3a4404b758
3 changed files with 11 additions and 0 deletions
|
|
@ -1470,6 +1470,10 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
default: {}
|
default: {}
|
||||||
properties:
|
properties:
|
||||||
|
runnerVersion:
|
||||||
|
description: >-
|
||||||
|
The version string of the runner.
|
||||||
|
type: string
|
||||||
cpus:
|
cpus:
|
||||||
description: >-
|
description: >-
|
||||||
Number of CPUs currently in use.
|
Number of CPUs currently in use.
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ public class Constants {
|
||||||
* Status related constants.
|
* Status related constants.
|
||||||
*/
|
*/
|
||||||
public static class Status {
|
public static class Status {
|
||||||
|
/** The Constant RUNNER_VERSION. */
|
||||||
|
public static final String RUNNER_VERSION = "runnerVersion";
|
||||||
|
|
||||||
/** The Constant CPUS. */
|
/** The Constant CPUS. */
|
||||||
public static final String CPUS = "cpus";
|
public static final String CPUS = "cpus";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import io.kubernetes.client.openapi.JSON;
|
||||||
import io.kubernetes.client.openapi.models.EventsV1Event;
|
import io.kubernetes.client.openapi.models.EventsV1Event;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import static org.jdrupes.vmoperator.common.Constants.APP_NAME;
|
import static org.jdrupes.vmoperator.common.Constants.APP_NAME;
|
||||||
import org.jdrupes.vmoperator.common.Constants.Crd;
|
import org.jdrupes.vmoperator.common.Constants.Crd;
|
||||||
|
|
@ -124,6 +125,9 @@ public class StatusUpdater extends VmDefUpdater {
|
||||||
observedGeneration = vmDef.getMetadata().getGeneration();
|
observedGeneration = vmDef.getMetadata().getGeneration();
|
||||||
vmStub.updateStatus(from -> {
|
vmStub.updateStatus(from -> {
|
||||||
JsonObject status = from.statusJson();
|
JsonObject status = from.statusJson();
|
||||||
|
status.addProperty(Status.RUNNER_VERSION, Optional.ofNullable(
|
||||||
|
Runner.class.getPackage().getImplementationVersion())
|
||||||
|
.orElse("(unknown)"));
|
||||||
status.remove(Status.LOGGED_IN_USER);
|
status.remove(Status.LOGGED_IN_USER);
|
||||||
return status;
|
return status;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue