reset progress on re-discovery
This fix handles the following case:
1. installation is aborted
2. host are going through force re-discovery
@@ -67,10 +67,12 @@ func (th *transitionHandler) PostRegisterHost(sw stateswitch.StateSwitch, args s
if _, err := common.GetHostFromDB(params.db, hostParam.InfraEnvID.String(), hostParam.ID.String()); err == nil {
// The reason for the double register is unknown (HW might have changed) -
// so we reset the hw info and progress, and start the discovery process again.
- // also log info is not current and should be resetted. In adition, due to late binding
- // the kind should be set to the hsotParam value, because in day2 it may be changed during re-registration
+ // also log info is not current and should be resetted, and progress should be cleared.
+ // In adition, due to late binding the kind should be set to the hostParam value,
+ // because in day2 it may be changed during re-registration
extra := append(resetFields[:], "discovery_agent_version", params.discoveryAgentVersion, "ntp_sources", "", "kind", hostParam.Kind)
extra = append(extra, resetLogsField...)
+ extra = append(extra, resetProgressFields...)
var dbHost *common.Host
if dbHost, err = hostutil.UpdateHostProgress(params.ctx, log, params.db, th.eventsHandler, hostParam.InfraEnvID, *hostParam.ID, sHost.srcState,
swag.StringValue(hostParam.Status), statusInfoDiscovering, hostParam.Progress.CurrentStage, "", "", extra...); err != nil {
