bugfix
Some checks are pending
CI / End-to-End (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-10-15 16:22:49 +11:00
parent f86ec3d615
commit 2a9489619d

View File

@@ -106,15 +106,19 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
params.UpdateType = "reconfigure" params.UpdateType = "reconfigure"
} }
case "config.managedBy": // This changes when a VM becomes a placeholder or vice versa case "config.managedBy": // This changes when a VM becomes a placeholder or vice versa
changeFound = true
params.UpdateType = "srm"
if change["newValue"] == "(extensionKey = \"com.vmware.vcDr\", type = \"placeholderVm\")" { if change["newValue"] == "(extensionKey = \"com.vmware.vcDr\", type = \"placeholderVm\")" {
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true} params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "<unset>" { } else if change["newValue"] == "<unset>" {
params.PlaceholderChange = sql.NullString{String: "Vm", Valid: true} params.PlaceholderChange = sql.NullString{String: "Vm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "testVm" { } else if change["newValue"] == "testVm" {
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true} params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else { } else {
h.Logger.Error("Unexpected value for managedBy configuration", "new_value", change["newValue"]) h.Logger.Error("Unexpected value for managedBy configuration", "new_value", change["newValue"])
} }
@@ -132,9 +136,13 @@ func (h *Handler) VmModifyEvent(w http.ResponseWriter, r *http.Request) {
if change["newValue"] == "testVm" { if change["newValue"] == "testVm" {
h.Logger.Debug("testVm") h.Logger.Debug("testVm")
params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true} params.PlaceholderChange = sql.NullString{String: "testVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} else if change["newValue"] == "placeholderVm" { } else if change["newValue"] == "placeholderVm" {
h.Logger.Debug("placeholderVm") h.Logger.Debug("placeholderVm")
params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true} params.PlaceholderChange = sql.NullString{String: "placeholderVm", Valid: true}
changeFound = true
params.UpdateType = "srm"
} }
} }