Skip to content

Commit 38579af

Browse files
committed
Updating ACS error custom counter after every ACS operation that returns an error.
1 parent 292ecb1 commit 38579af

File tree

8 files changed

+59
-7
lines changed

8 files changed

+59
-7
lines changed

pkg/cloud/affinity_groups.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func (c *client) FetchAffinityGroup(group *AffinityGroup) (reterr error) {
4545
affinityGroup, count, err := c.cs.AffinityGroup.GetAffinityGroupByID(group.ID)
4646
if err != nil {
4747
// handle via multierr
48+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
4849
return err
4950
} else if count > 1 {
5051
// handle via creating a new error.
@@ -59,6 +60,7 @@ func (c *client) FetchAffinityGroup(group *AffinityGroup) (reterr error) {
5960
affinityGroup, count, err := c.cs.AffinityGroup.GetAffinityGroupByName(group.Name)
6061
if err != nil {
6162
// handle via multierr
63+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
6264
return err
6365
} else if count > 1 {
6466
// handle via creating a new error.
@@ -78,6 +80,7 @@ func (c *client) GetOrCreateAffinityGroup(group *AffinityGroup) (retErr error) {
7880
p.SetName(group.Name)
7981
resp, err := c.cs.AffinityGroup.CreateAffinityGroup(p)
8082
if err != nil {
83+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
8184
return err
8285
}
8386
group.ID = resp.Id
@@ -90,6 +93,7 @@ func (c *client) DeleteAffinityGroup(group *AffinityGroup) (retErr error) {
9093
setIfNotEmpty(group.ID, p.SetId)
9194
setIfNotEmpty(group.Name, p.SetName)
9295
_, retErr = c.cs.AffinityGroup.DeleteAffinityGroup(p)
96+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
9397
return retErr
9498
}
9599

@@ -98,6 +102,7 @@ type affinityGroups []AffinityGroup
98102
func (c *client) getCurrentAffinityGroups(csMachine *infrav1.CloudStackMachine) (affinityGroups, error) {
99103
// Start by fetching VM details which includes an array of currently associated affinity groups.
100104
if virtM, count, err := c.cs.VirtualMachine.GetVirtualMachineByID(*csMachine.Spec.InstanceID); err != nil {
105+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
101106
return nil, err
102107
} else if count > 1 {
103108
return nil, errors.Errorf("found more than one VM for ID: %s", *csMachine.Spec.InstanceID)
@@ -149,15 +154,18 @@ func (c *client) stopAndModifyAffinityGroups(csMachine *infrav1.CloudStackMachin
149154

150155
p1 := c.cs.VirtualMachine.NewStopVirtualMachineParams(string(*csMachine.Spec.InstanceID))
151156
if _, err := c.cs.VirtualMachine.StopVirtualMachine(p1); err != nil {
157+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
152158
return err
153159
}
154160

155161
if _, err := c.cs.AffinityGroup.UpdateVMAffinityGroup(agp); err != nil {
162+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
156163
return err
157164
}
158165

159166
p2 := c.cs.VirtualMachine.NewStartVirtualMachineParams(string(*csMachine.Spec.InstanceID))
160167
_, err := c.cs.VirtualMachine.StartVirtualMachine(p2)
168+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
161169
return err
162170
}
163171

pkg/cloud/instance.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func (c *client) ResolveVMInstanceDetails(csMachine *infrav1.CloudStackMachine)
5656
if csMachine.Spec.InstanceID != nil {
5757
vmResp, count, err := c.cs.VirtualMachine.GetVirtualMachinesMetricByID(*csMachine.Spec.InstanceID)
5858
if err != nil && !strings.Contains(strings.ToLower(err.Error()), "no match found") {
59+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
5960
return err
6061
} else if count > 1 {
6162
return fmt.Errorf("found more than one VM Instance with ID %s", *csMachine.Spec.InstanceID)
@@ -69,6 +70,7 @@ func (c *client) ResolveVMInstanceDetails(csMachine *infrav1.CloudStackMachine)
6970
if csMachine.Name != "" {
7071
vmResp, count, err := c.cs.VirtualMachine.GetVirtualMachinesMetricByName(csMachine.Name) // add opts usage
7172
if err != nil && !strings.Contains(strings.ToLower(err.Error()), "no match") {
73+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
7274
return err
7375
} else if count > 1 {
7476
return fmt.Errorf("found more than one VM Instance with name %s", csMachine.Name)
@@ -84,6 +86,7 @@ func (c *client) ResolveServiceOffering(csMachine *infrav1.CloudStackMachine) (o
8486
if len(csMachine.Spec.Offering.ID) > 0 {
8587
csOffering, count, err := c.cs.ServiceOffering.GetServiceOfferingByID(csMachine.Spec.Offering.ID)
8688
if err != nil {
89+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
8790
return "", multierror.Append(retErr, errors.Wrapf(
8891
err, "could not get Service Offering by ID %s", csMachine.Spec.Offering.ID))
8992
} else if count != 1 {
@@ -99,6 +102,7 @@ func (c *client) ResolveServiceOffering(csMachine *infrav1.CloudStackMachine) (o
99102
}
100103
offeringID, count, err := c.cs.ServiceOffering.GetServiceOfferingID(csMachine.Spec.Offering.Name)
101104
if err != nil {
105+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
102106
return "", multierror.Append(retErr, errors.Wrapf(
103107
err, "could not get Service Offering ID from %s", csMachine.Spec.Offering.Name))
104108
} else if count != 1 {
@@ -116,6 +120,7 @@ func (c *client) ResolveTemplate(
116120
if len(csMachine.Spec.Template.ID) > 0 {
117121
csTemplate, count, err := c.cs.Template.GetTemplateByID(csMachine.Spec.Template.ID, "executable")
118122
if err != nil {
123+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
119124
return "", multierror.Append(retErr, errors.Wrapf(
120125
err, "could not get Template by ID %s", csMachine.Spec.Template.ID))
121126
} else if count != 1 {
@@ -131,6 +136,7 @@ func (c *client) ResolveTemplate(
131136
}
132137
templateID, count, err := c.cs.Template.GetTemplateID(csMachine.Spec.Template.Name, "executable", zoneID)
133138
if err != nil {
139+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
134140
return "", multierror.Append(retErr, errors.Wrapf(
135141
err, "could not get Template ID from %s", csMachine.Spec.Template.Name))
136142
} else if count != 1 {
@@ -148,6 +154,7 @@ func (c *client) ResolveDiskOffering(csMachine *infrav1.CloudStackMachine) (disk
148154
if len(csMachine.Spec.DiskOffering.Name) > 0 {
149155
diskID, count, err := c.cs.DiskOffering.GetDiskOfferingID(csMachine.Spec.DiskOffering.Name)
150156
if err != nil {
157+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
151158
return "", multierror.Append(retErr, errors.Wrapf(
152159
err, "could not get DiskOffering ID from %s", csMachine.Spec.DiskOffering.Name))
153160
} else if count != 1 {
@@ -174,6 +181,7 @@ func (c *client) ResolveDiskOffering(csMachine *infrav1.CloudStackMachine) (disk
174181
func verifyDiskoffering(csMachine *infrav1.CloudStackMachine, c *client, diskOfferingID string, retErr error) (string, error) {
175182
csDiskOffering, count, err := c.cs.DiskOffering.GetDiskOfferingByID(diskOfferingID)
176183
if err != nil {
184+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
177185
return "", multierror.Append(retErr, errors.Wrapf(
178186
err, "could not get DiskOffering by ID %s", diskOfferingID))
179187
} else if count != 1 {
@@ -255,6 +263,8 @@ func (c *client) GetOrCreateVMInstance(
255263

256264
deployVMResp, err := c.cs.VirtualMachine.DeployVirtualMachine(p)
257265
if err != nil {
266+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
267+
258268
// Just because an error was returned doesn't mean a (failed) VM wasn't created and will need to be dealt with.
259269
// Regretfully the deployVMResp may be nil, so we need to get the VM ID with a separate query, so we
260270
// can return it to the caller, so they can clean it up.
@@ -265,6 +275,8 @@ func (c *client) GetOrCreateVMInstance(
265275
listVirtualMachineParams.SetName(csMachine.Name)
266276
if listVirtualMachinesResponse, err2 := c.cs.VirtualMachine.ListVirtualMachines(listVirtualMachineParams); err2 == nil && listVirtualMachinesResponse.Count > 0 {
267277
csMachine.Spec.InstanceID = pointer.StringPtr(listVirtualMachinesResponse.VirtualMachines[0].Id)
278+
} else {
279+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err2)
268280
}
269281
return err
270282
}
@@ -290,6 +302,7 @@ func (c *client) DestroyVMInstance(csMachine *infrav1.CloudStackMachine) error {
290302
// VM doesn't exist. Success...
291303
return nil
292304
} else if err != nil {
305+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
293306
return err
294307
}
295308

@@ -316,6 +329,7 @@ func (c *client) listVMInstanceDatadiskVolumeIDs(instanceID string) ([]string, e
316329

317330
listVOLResp, err := c.csAsync.Volume.ListVolumes(p)
318331
if err != nil {
332+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
319333
return nil, err
320334
}
321335

pkg/cloud/isolated_network.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type IsoNetworkIface interface {
4444
func (c *client) getOfferingID() (string, error) {
4545
offeringID, count, retErr := c.cs.NetworkOffering.GetNetworkOfferingID(NetOffering)
4646
if retErr != nil {
47+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
4748
return "", retErr
4849
} else if count != 1 {
4950
return "", errors.New("found more than one network offering")
@@ -60,7 +61,6 @@ func (c *client) AssociatePublicIPAddress(
6061
// Check specified IP address is available or get an unused one if not specified.
6162
publicAddress, err := c.GetPublicIP(zone, isoNet, csCluster)
6263
if err != nil {
63-
c.customMetrics.IncrementAcsReconciliationErrors(err)
6464
return errors.Wrapf(err, "fetching a public IP address")
6565
}
6666
isoNet.Spec.ControlPlaneEndpoint.Host = publicAddress.Ipaddress
@@ -77,6 +77,7 @@ func (c *client) AssociatePublicIPAddress(
7777
p.SetIpaddress(isoNet.Spec.ControlPlaneEndpoint.Host)
7878
p.SetNetworkid(isoNet.Spec.ID)
7979
if _, err := c.cs.Address.AssociateIpAddress(p); err != nil {
80+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
8081
return errors.Wrapf(err,
8182
"associating public IP address with ID %s to network with ID %s",
8283
publicAddress.Id, isoNet.Spec.ID)
@@ -102,6 +103,7 @@ func (c *client) CreateIsolatedNetwork(zone *capcv1.CloudStackZone, isoNet *capc
102103
p := c.cs.Network.NewCreateNetworkParams(isoNet.Spec.Name, isoNet.Spec.Name, offeringID, zone.Spec.ID)
103104
resp, err := c.cs.Network.CreateNetwork(p)
104105
if err != nil {
106+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
105107
return errors.Wrapf(err, "creating network with name %s", isoNet.Spec.Name)
106108
}
107109
isoNet.Spec.ID = resp.Id
@@ -115,6 +117,7 @@ func (c *client) OpenFirewallRules(isoNet *capcv1.CloudStackIsolatedNetwork) (re
115117
if retErr != nil && strings.Contains(strings.ToLower(retErr.Error()), "there is already") { // Already a firewall rule here.
116118
retErr = nil
117119
}
120+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
118121
return retErr
119122
}
120123

@@ -132,6 +135,7 @@ func (c *client) GetPublicIP(
132135
setIfNotEmpty(ip, p.SetIpaddress)
133136
publicAddresses, err := c.cs.Address.ListPublicIpAddresses(p)
134137
if err != nil {
138+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
135139
return nil, err
136140
} else if ip != "" && publicAddresses.Count == 1 { // Endpoint specified and IP found.
137141
// Ignore already allocated here since the IP was specified.
@@ -157,6 +161,7 @@ func (c *client) GetPublicIP(
157161
func (c *client) GetIsolatedNetwork(isoNet *capcv1.CloudStackIsolatedNetwork) (retErr error) {
158162
netDetails, count, err := c.cs.Network.GetNetworkByName(isoNet.Spec.Name)
159163
if err != nil {
164+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
160165
retErr = multierror.Append(retErr, errors.Wrapf(err, "could not get Network ID from %s", isoNet.Spec.Name))
161166
} else if count != 1 {
162167
retErr = multierror.Append(retErr, errors.Errorf(
@@ -168,6 +173,7 @@ func (c *client) GetIsolatedNetwork(isoNet *capcv1.CloudStackIsolatedNetwork) (r
168173

169174
netDetails, count, err = c.cs.Network.GetNetworkByID(isoNet.Spec.ID)
170175
if err != nil {
176+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
171177
return multierror.Append(retErr, errors.Wrapf(err, "could not get Network by ID %s", isoNet.Spec.ID))
172178
} else if count != 1 {
173179
return multierror.Append(retErr, errors.Errorf("expected 1 Network with UUID %s, but got %d", isoNet.Spec.ID, count))
@@ -186,6 +192,7 @@ func (c *client) ResolveLoadBalancerRuleDetails(
186192
p.SetPublicipid(isoNet.Status.PublicIPID)
187193
loadBalancerRules, err := c.cs.LoadBalancer.ListLoadBalancerRules(p)
188194
if err != nil {
195+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
189196
return errors.Wrap(err, "listing load balancer rules")
190197
}
191198
for _, rule := range loadBalancerRules.LoadBalancerRules {
@@ -230,6 +237,7 @@ func (c *client) GetOrCreateLoadBalancerRule(
230237
p.SetProtocol(NetworkProtocolTCP)
231238
resp, err := c.cs.LoadBalancer.CreateLoadBalancerRule(p)
232239
if err != nil {
240+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
233241
return err
234242
}
235243
isoNet.Status.LBRuleID = resp.Id
@@ -279,6 +287,7 @@ func (c *client) AssignVMToLoadBalancerRule(isoNet *capcv1.CloudStackIsolatedNet
279287
lbRuleInstances, retErr := c.cs.LoadBalancer.ListLoadBalancerRuleInstances(
280288
c.cs.LoadBalancer.NewListLoadBalancerRuleInstancesParams(isoNet.Status.LBRuleID))
281289
if retErr != nil {
290+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
282291
return retErr
283292
}
284293
for _, instance := range lbRuleInstances.LoadBalancerRuleInstances {
@@ -291,12 +300,14 @@ func (c *client) AssignVMToLoadBalancerRule(isoNet *capcv1.CloudStackIsolatedNet
291300
p := c.cs.LoadBalancer.NewAssignToLoadBalancerRuleParams(isoNet.Status.LBRuleID)
292301
p.SetVirtualmachineids([]string{instanceID})
293302
_, retErr = c.cs.LoadBalancer.AssignToLoadBalancerRule(p)
303+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
294304
return retErr
295305
}
296306

297307
// DeleteNetwork deletes an isolated network.
298308
func (c *client) DeleteNetwork(net capcv1.Network) error {
299309
_, err := c.cs.Network.DeleteNetwork(c.cs.Network.NewDeleteNetworkParams(net.ID))
310+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
300311
return errors.Wrapf(err, "deleting network with id %s", net.ID)
301312
}
302313

@@ -351,6 +362,7 @@ func (c *client) DisassociatePublicIPAddressIfNotInUse(isoNet *capcv1.CloudStack
351362
if tagsAllowDisposal, err := c.DoClusterTagsAllowDisposal(ResourceTypeIPAddress, isoNet.Status.PublicIPID); err != nil {
352363
return err
353364
} else if publicIP, _, err := c.cs.Address.GetPublicIpAddressByID(isoNet.Status.PublicIPID); err != nil {
365+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
354366
return err
355367
} else if publicIP == nil || publicIP.Issourcenat { // Can't disassociate an address if it's the source NAT address.
356368
return nil
@@ -370,5 +382,6 @@ func (c *client) DisassociatePublicIPAddress(isoNet *capcv1.CloudStackIsolatedNe
370382

371383
p := c.cs.Address.NewDisassociateIpAddressParams(isoNet.Status.PublicIPID)
372384
_, retErr = c.cs.Address.DisassociateIpAddress(p)
385+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
373386
return retErr
374387
}

pkg/cloud/network.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func (c *client) ResolveNetwork(net *capcv1.Network) (retErr error) {
5050
netName := net.Name
5151
netDetails, count, err := c.cs.Network.GetNetworkByName(netName)
5252
if err != nil {
53+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
5354
retErr = multierror.Append(retErr, errors.Wrapf(err, "could not get Network ID from %s", netName))
5455
} else if count != 1 {
5556
retErr = multierror.Append(retErr, errors.Errorf(
@@ -65,6 +66,7 @@ func (c *client) ResolveNetwork(net *capcv1.Network) (retErr error) {
6566
if err != nil {
6667
return multierror.Append(retErr, errors.Wrapf(err, "could not get Network by ID %s", net.ID))
6768
} else if count != 1 {
69+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
6870
return multierror.Append(retErr, errors.Errorf("expected 1 Network with UUID %s, but got %d", net.ID, count))
6971
}
7072
net.Name = netDetails.Name

pkg/cloud/tags.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (c *client) DoClusterTagsAllowDisposal(resourceType ResourceType, resourceI
119119
func (c *client) AddTags(resourceType ResourceType, resourceID string, tags map[string]string) error {
120120
p := c.cs.Resourcetags.NewCreateTagsParams([]string{resourceID}, string(resourceType), tags)
121121
_, err := c.cs.Resourcetags.CreateTags(p)
122+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
122123
return ignoreAlreadyPresentErrors(err, resourceType, resourceID)
123124
}
124125

@@ -130,6 +131,7 @@ func (c *client) GetTags(resourceType ResourceType, resourceID string) (map[stri
130131
p.SetListall(true)
131132
listTagResponse, err := c.cs.Resourcetags.ListTags(p)
132133
if err != nil {
134+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
133135
return nil, err
134136
}
135137
tags := make(map[string]string, listTagResponse.Count)
@@ -146,8 +148,10 @@ func (c *client) DeleteTags(resourceType ResourceType, resourceID string, tagsTo
146148
p := c.cs.Resourcetags.NewDeleteTagsParams([]string{resourceID}, string(resourceType))
147149
p.SetTags(tagsToDelete)
148150
if _, err1 := c.cs.Resourcetags.DeleteTags(p); err1 != nil { // Error in deletion attempt. Check for tag.
151+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err1)
149152
currTag := map[string]string{tagkey: tagval}
150153
if tags, err2 := c.GetTags(resourceType, resourceID); len(tags) != 0 {
154+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err2)
151155
if _, foundTag := tags[tagkey]; foundTag {
152156
return errors.Wrapf(multierror.Append(err1, err2),
153157
"could not remove tag %s from %s with ID %s", currTag, resourceType, resourceID)

pkg/cloud/user_credentials.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func (c *client) ResolveDomain(domain *Domain) error {
9191

9292
resp, retErr := c.cs.Domain.ListDomains(p)
9393
if retErr != nil {
94+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
9495
return retErr
9596
}
9697

@@ -139,6 +140,7 @@ func (c *client) ResolveAccount(account *Account) error {
139140
setIfNotEmpty(account.Name, p.SetName)
140141
resp, retErr := c.cs.Account.ListAccounts(p)
141142
if retErr != nil {
143+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(retErr)
142144
return retErr
143145
} else if resp.Count == 0 {
144146
return errors.Errorf("could not find account %s", account.Name)
@@ -164,6 +166,7 @@ func (c *client) ResolveUser(user *User) error {
164166
p.SetListall(true)
165167
resp, err := c.cs.User.ListUsers(p)
166168
if err != nil {
169+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
167170
return err
168171
} else if resp.Count != 1 {
169172
return errors.Errorf("expected 1 User with username %s but got %d", user.Name, resp.Count)
@@ -185,6 +188,7 @@ func (c *client) ResolveUserKeys(user *User) error {
185188
p := c.cs.User.NewGetUserKeysParams(user.ID)
186189
resp, err := c.cs.User.GetUserKeys(p)
187190
if err != nil {
191+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
188192
return errors.Errorf("error encountered when resolving user api keys for user %s", user.Name)
189193
}
190194
user.APIKey = resp.Apikey
@@ -207,6 +211,7 @@ func (c *client) GetUserWithKeys(user *User) (bool, error) {
207211
p.SetListall(true)
208212
resp, err := c.cs.User.ListUsers(p)
209213
if err != nil {
214+
c.customMetrics.EvaluateErrorAndIncrementAcsReconciliationErrorCounter(err)
210215
return false, err
211216
}
212217

0 commit comments

Comments
 (0)