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
|
||||
default: {}
|
||||
properties:
|
||||
runnerVersion:
|
||||
description: >-
|
||||
The version string of the runner.
|
||||
type: string
|
||||
cpus:
|
||||
description: >-
|
||||
Number of CPUs currently in use.
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ public class Constants {
|
|||
* Status related constants.
|
||||
*/
|
||||
public static class Status {
|
||||
/** The Constant RUNNER_VERSION. */
|
||||
public static final String RUNNER_VERSION = "runnerVersion";
|
||||
|
||||
/** The Constant 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 java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Level;
|
||||
import static org.jdrupes.vmoperator.common.Constants.APP_NAME;
|
||||
import org.jdrupes.vmoperator.common.Constants.Crd;
|
||||
|
|
@ -124,6 +125,9 @@ public class StatusUpdater extends VmDefUpdater {
|
|||
observedGeneration = vmDef.getMetadata().getGeneration();
|
||||
vmStub.updateStatus(from -> {
|
||||
JsonObject status = from.statusJson();
|
||||
status.addProperty(Status.RUNNER_VERSION, Optional.ofNullable(
|
||||
Runner.class.getPackage().getImplementationVersion())
|
||||
.orElse("(unknown)"));
|
||||
status.remove(Status.LOGGED_IN_USER);
|
||||
return status;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue