Clear logged in user on startup and shutdown.
This commit is contained in:
parent
62a7210117
commit
4a242c4657
1 changed files with 10 additions and 2 deletions
|
|
@ -114,8 +114,15 @@ public class StatusUpdater extends VmDefUpdater {
|
||||||
vmStub = VmDefinitionStub.get(apiClient,
|
vmStub = VmDefinitionStub.get(apiClient,
|
||||||
new GroupVersionKind(VM_OP_GROUP, "", VM_OP_KIND_VM),
|
new GroupVersionKind(VM_OP_GROUP, "", VM_OP_KIND_VM),
|
||||||
namespace, vmName);
|
namespace, vmName);
|
||||||
vmStub.model().ifPresent(model -> {
|
var vmDef = vmStub.model().orElse(null);
|
||||||
observedGeneration = model.getMetadata().getGeneration();
|
if (vmDef == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
observedGeneration = vmDef.getMetadata().getGeneration();
|
||||||
|
vmStub.updateStatus(from -> {
|
||||||
|
JsonObject status = from.statusJson();
|
||||||
|
status.remove("loggedInUser");
|
||||||
|
return status;
|
||||||
});
|
});
|
||||||
} catch (ApiException e) {
|
} catch (ApiException e) {
|
||||||
logger.log(Level.SEVERE, e,
|
logger.log(Level.SEVERE, e,
|
||||||
|
|
@ -197,6 +204,7 @@ public class StatusUpdater extends VmDefUpdater {
|
||||||
} else if (event.runState() == RunState.STOPPED) {
|
} else if (event.runState() == RunState.STOPPED) {
|
||||||
status.addProperty("ram", "0");
|
status.addProperty("ram", "0");
|
||||||
status.addProperty("cpus", 0);
|
status.addProperty("cpus", 0);
|
||||||
|
status.remove("loggedInUser");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!running) {
|
if (!running) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue