ronething commented on code in PR #2460:
URL:
https://github.com/apache/apisix-ingress-controller/pull/2460#discussion_r2188846868
##########
internal/provider/adc/adc.go:
##########
@@ -404,3 +415,150 @@ func prepareSyncFile(resources any) (string, func(),
error) {
return tmpFile.Name(), cleanup, nil
}
+
+func (d *adcClient) handlerADCExecutionErrors(statusesMap
map[string]types.ADCExecutionErrors) {
+ statusUpdateMap := d.resolveADCExecutionErrors(statusesMap)
+ d.handlerStatusUpdate(statusUpdateMap)
+}
+
+func (d *adcClient) handlerStatusUpdate(statusUpdateMap
map[types.NamespacedNameKind][]string) {
+ for nnk, msgs := range statusUpdateMap {
+ d.updateStatus(nnk, cutils.NewConditionTypeAccepted(
+ apiv2.ConditionReasonSyncFailed,
+ false,
+ 0,
+ strings.Join(msgs, "; "),
+ ))
+ }
+
+ for nnk := range d.statusUpdateMap {
+ if _, ok := statusUpdateMap[nnk]; !ok {
+ d.updateStatus(nnk, cutils.NewConditionTypeAccepted(
+ apiv2.ConditionReasonAccepted,
+ true,
+ 0,
+ "",
+ ))
+ }
+ }
Review Comment:
Regarding the handling of `statusUpdateMap` and `d.statusUpdateMap` by this
function, I think we need to add more comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]