Skip to content

Commit

Permalink
Fix for InvalidLaunchTemplateId.NotFound error (#5665)
Browse files Browse the repository at this point in the history
  • Loading branch information
jigisha620 authored Feb 15, 2024
1 parent 1fd08c0 commit fe3aeac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import (
)

const (
launchTemplateNotFoundCode = "InvalidLaunchTemplateName.NotFoundException"
launchTemplateNameNotFoundCode = "InvalidLaunchTemplateName.NotFoundException"
)

var (
// This is not an exhaustive list, add to it as needed
notFoundErrorCodes = sets.New[string](
"InvalidInstanceID.NotFound",
launchTemplateNotFoundCode,
launchTemplateNameNotFoundCode,
"InvalidLaunchTemplateId.NotFound",
sqs.ErrCodeQueueDoesNotExist,
iam.ErrCodeNoSuchEntityException,
)
Expand Down Expand Up @@ -102,7 +103,7 @@ func IsLaunchTemplateNotFound(err error) bool {
}
var awsError awserr.Error
if errors.As(err, &awsError) {
return awsError.Code() == launchTemplateNotFoundCode
return awsError.Code() == launchTemplateNameNotFoundCode
}
return false
}

0 comments on commit fe3aeac

Please sign in to comment.