fix charts
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-14 11:14:46 +11:00
parent 5c34a9eacd
commit 013ae4568e
3 changed files with 31 additions and 33 deletions

View File

@@ -116,22 +116,23 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
params.UpdateType = "reconfigure"
}
case "config.managedBy": // This changes when a VM becomes a placeholder or vice versa
if change["newValue"] == "(extensionKey = \"com.vmware.vcDr\", type = \"placeholderVm\")" {
switch change["newValue"] {
case "(extensionKey = \"com.vmware.vcDr\", type = \"placeholderVm\")":
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
h.Logger.Debug("placeholderVm")
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "<unset>" {
case "<unset>":
params.PlaceholderChange = sql.NullString{String: "Vm", Valid: true}
h.Logger.Debug("vm")
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "testVm" {
case "testVm":
h.Logger.Debug("testVm")
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else {
default:
h.Logger.Error("Unexpected value for managedBy configuration", "new_value", change["newValue"])
}
@@ -145,12 +146,13 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
// TODO - track when this happens, maybe need a new database column?
case "config.managedBy.type":
h.Logger.Debug("config.managedBy.type")
if change["newValue"] == "testVm" {
switch change["newValue"] {
case "testVm":
h.Logger.Debug("testVm")
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "\\\"placeholderVm\\\"" {
case "\\\"placeholderVm\\\"":
h.Logger.Debug("placeholderVm")
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
changeFound = true