Skip to content

Commit

Permalink
Issue #3593 - Bug: auto-upgrade of ha group edge devices does not per…
Browse files Browse the repository at this point in the history
…form rolling update (#3609)

Signed-off-by: Max McAdam <max@fredcom.com>

Signed-off-by: Max McAdam <max@fredcom.com>
  • Loading branch information
MaxMcAdam authored Jan 26, 2023
1 parent 12547d9 commit c43bffb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion agreementbot/agreementbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ func (w *AgreementBotWorker) monitorHAGroupNMPUpdates() int {
if err != nil {
glog.Errorf(AWlogString(fmt.Sprintf("error deleting nmp status %v/%v/%v: %v", node.OrgId, node.NodeId, node.NMPName, err)))
} else {
glog.Errorf("removed %v/%v/%v", node.OrgId, node.NodeId, node.NMPName)
glog.V(3).Infof(AWlogString(fmt.Sprintf("removed %v/%v/%v from ha nmp upgrade table", node.OrgId, node.NodeId, node.NMPName)))
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions exchange/node_management_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func GetNodeManagementPolicyStatus(ec ExchangeContext, orgId string, nodeId stri
glog.V(3).Infof("Getting node management policy status for node %v/%v and policy %v", orgId, nodeId, policyName)

var resp interface{}
resp = new(exchangecommon.NodeManagementPolicyStatus)
resp = new(exchangecommon.ExchangeNMPStatus)

_, policyName = cutil.SplitOrgSpecUrl(policyName)

Expand All @@ -23,7 +23,12 @@ func GetNodeManagementPolicyStatus(ec ExchangeContext, orgId string, nodeId stri
return nil, err
}

nmpStatus := resp.(*exchangecommon.NodeManagementPolicyStatus)
nmpStatusMap := resp.(*exchangecommon.ExchangeNMPStatus)
nmpStatus, ok := nmpStatusMap.ManagementStatus[fmt.Sprintf("%v/%v", orgId, policyName)]
if !ok {
return nil, fmt.Errorf("Error: status for policy %v/%v not found in exchange status list %v", orgId, policyName, resp)
}

return nmpStatus, nil
}

Expand Down
2 changes: 2 additions & 0 deletions exchange/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ func InvokeExchange(httpClient *http.Client, method string, urlPath string, user
case *exchangecommon.NodeManagementPolicyStatus:
return nil, nil

case *exchangecommon.ExchangeNMPStatus:
return nil, nil
default:
return errors.New(fmt.Sprintf("Unknown type of response object %v (%T) passed to invocation of %v at %v with %v", *resp, *resp, method, urlPath, requestBody)), nil
}
Expand Down

0 comments on commit c43bffb

Please # to comment.