Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
johngmyers committed Jun 18, 2023
1 parent 1a4c7b5 commit bb4e747
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
4 changes: 2 additions & 2 deletions provider/aws/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ limitations under the License.
package aws

import (
"fmt"
"strings"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/linki/instrumented_http"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"

"sigs.k8s.io/external-dns/pkg/apis/externaldns"
Expand Down Expand Up @@ -54,7 +54,7 @@ func NewSession(awsConfig AWSSessionConfig) (*session.Session, error) {
SharedConfigState: session.SharedConfigEnable,
})
if err != nil {
return nil, errors.Wrap(err, "failed to instantiate AWS session")
return nil, fmt.Errorf("instantiating AWS session: %w", err)
}

if awsConfig.AssumeRole != "" {
Expand Down
7 changes: 1 addition & 6 deletions registry/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (im *DynamoDBRegistry) ApplyChanges(ctx context.Context, changes *plan.Chan
key := fromDynamoKey(request.Parameters[0])
for i, endpoint := range filteredChanges.Create {
if endpoint.Key() == key {
log.Warnf("Skipping endpoint %v because owner does not match", endpoint)
log.Infof("Skipping endpoint %v because owner does not match", endpoint)
filteredChanges.Create = append(filteredChanges.Create[:i], filteredChanges.Create[i+1:]...)
// The dynamodb insertion failed; remove from our cache.
im.removeFromCache(endpoint)
Expand Down Expand Up @@ -258,10 +258,6 @@ func (im *DynamoDBRegistry) AdjustEndpoints(endpoints []*endpoint.Endpoint) []*e
return im.provider.AdjustEndpoints(endpoints)
}

/**
DynamoDB registry-specific private methods.
*/

func (im *DynamoDBRegistry) readLabels(ctx context.Context) error {
table, err := im.dynamodbAPI.DescribeTableWithContext(ctx, &dynamodb.DescribeTableInput{
TableName: aws.String(im.table),
Expand Down Expand Up @@ -428,7 +424,6 @@ func (im *DynamoDBRegistry) addToCache(ep *endpoint.Endpoint) {

func (im *DynamoDBRegistry) removeFromCache(ep *endpoint.Endpoint) {
if im.recordsCache == nil || ep == nil {
// return early.
return
}

Expand Down
5 changes: 0 additions & 5 deletions registry/txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,6 @@ func (im *TXTRegistry) AdjustEndpoints(endpoints []*endpoint.Endpoint) []*endpoi
return im.provider.AdjustEndpoints(endpoints)
}

/**
TXT registry specific private methods
*/

/**
nameMapper is the interface for mapping between the endpoint for the source
and the endpoint for the TXT record.
Expand Down Expand Up @@ -452,7 +448,6 @@ func (im *TXTRegistry) addToCache(ep *endpoint.Endpoint) {

func (im *TXTRegistry) removeFromCache(ep *endpoint.Endpoint) {
if im.recordsCache == nil || ep == nil {
// return early.
return
}

Expand Down

0 comments on commit bb4e747

Please sign in to comment.