Skip to content

Commit

Permalink
Address code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
stoyanr committed Aug 30, 2021
1 parent 65db84e commit e8170f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/aws/client/client_route53.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func isValuesDoNotMatchError(err error) bool {
return false
}

// IsNoSuchHostedZoneError returns true if the error indicates a non-existing route53 hosted zone.
func IsNoSuchHostedZoneError(err error) bool {
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == route53.ErrCodeNoSuchHostedZone {
return true
Expand All @@ -326,6 +327,7 @@ func IsNoSuchHostedZoneError(err error) bool {

var notPermittedInZoneRegex = regexp.MustCompile(`RRSet with DNS name [^\ ]+ is not permitted in zone [^\ ]+`)

// IsNotPermittedInZoneError returns true if the error indicates that the DNS name is not permitted in the route53 hosted zone.
func IsNotPermittedInZoneError(err error) bool {
if aerr, ok := err.(awserr.Error); ok && aerr.Code() == route53.ErrCodeInvalidChangeBatch && notPermittedInZoneRegex.MatchString(aerr.Message()) {
return true
Expand Down

0 comments on commit e8170f9

Please sign in to comment.