Skip to content

Commit

Permalink
fix pnic with web auto heal settings (actions) (#23836)
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte authored Nov 8, 2023
1 parent 13e6297 commit 62bcefa
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions internal/services/appservice/helpers/auto_heal.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,17 +466,18 @@ func expandAutoHealSettingsWindows(autoHealSettings []AutoHealSettingWindows) *w
result.Triggers.StatusCodesRange = &statusCodeRangeTriggers
}

action := autoHeal.Actions[0]
result.Actions.ActionType = web.AutoHealActionType(action.ActionType)
result.Actions.MinProcessExecutionTime = pointer.To(action.MinimumProcessTime)
if len(action.CustomAction) != 0 {
customAction := action.CustomAction[0]
result.Actions.CustomAction = &web.AutoHealCustomAction{
Exe: pointer.To(customAction.Executable),
Parameters: pointer.To(customAction.Parameters),
if len(autoHeal.Actions) > 0 {
action := autoHeal.Actions[0]
result.Actions.ActionType = web.AutoHealActionType(action.ActionType)
result.Actions.MinProcessExecutionTime = pointer.To(action.MinimumProcessTime)
if len(action.CustomAction) != 0 {
customAction := action.CustomAction[0]
result.Actions.CustomAction = &web.AutoHealCustomAction{
Exe: pointer.To(customAction.Executable),
Parameters: pointer.To(customAction.Parameters),
}
}
}

return result
}

Expand Down

0 comments on commit 62bcefa

Please sign in to comment.