Skip to content

Commit

Permalink
Fixes the OCI provider softerror failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jrosinsk committed Jan 26, 2024
1 parent 1bc6857 commit 38b6c72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions provider/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (p *OCIProvider) addPaginatedZones(ctx context.Context, zones map[string]dn
Page: page,
})
if err != nil {
return errors.Wrapf(err, "listing zones in %s", p.cfg.CompartmentID)
return provider.NewSoftError(errors.Wrapf(err, "listing zones in %s", p.cfg.CompartmentID))
}
for _, zone := range resp.Items {
if p.domainFilter.Match(*zone.Name) && p.zoneIDFilter.Match(*zone.Id) {
Expand Down Expand Up @@ -211,7 +211,7 @@ func (p *OCIProvider) newFilteredRecordOperations(endpoints []*endpoint.Endpoint
func (p *OCIProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error) {
zones, err := p.zones(ctx)
if err != nil {
return nil, errors.Wrap(err, "getting zones")
return nil, provider.NewSoftError(errors.Wrap(err, "getting zones"))
}

endpoints := []*endpoint.Endpoint{}
Expand All @@ -224,7 +224,7 @@ func (p *OCIProvider) Records(ctx context.Context) ([]*endpoint.Endpoint, error)
CompartmentId: &p.cfg.CompartmentID,
})
if err != nil {
return nil, errors.Wrapf(err, "getting records for zone %q", *zone.Id)
return nil, provider.NewSoftError(errors.Wrapf(err, "getting records for zone %q", *zone.Id))
}

for _, record := range resp.Items {
Expand Down Expand Up @@ -269,7 +269,7 @@ func (p *OCIProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) e

zones, err := p.zones(ctx)
if err != nil {
return errors.Wrap(err, "fetching zones")
return provider.NewSoftError(errors.Wrap(err, "fetching zones"))
}

// Separate into per-zone change sets to be passed to OCI API.
Expand All @@ -291,7 +291,7 @@ func (p *OCIProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) e
ZoneNameOrId: &zoneID,
PatchZoneRecordsDetails: dns.PatchZoneRecordsDetails{Items: ops},
}); err != nil {
return err
return provider.NewSoftError(err)
}
}

Expand Down

0 comments on commit 38b6c72

Please sign in to comment.