Skip to content

Commit

Permalink
Ignore not found error upon deleting efs system
Browse files Browse the repository at this point in the history
  • Loading branch information
hebelsan committed Sep 30, 2024
1 parent 1e147a4 commit 7cc4774
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/aws/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2007,7 +2007,7 @@ func (c *Client) CreateEfsFileSystem(ctx context.Context, input *efs.CreateFileS
// DeleteEfsFileSystem deletes an efs file system
func (c *Client) DeleteEfsFileSystem(ctx context.Context, input *efs.DeleteFileSystemInput) error {
_, err := c.EFS.DeleteFileSystemWithContext(ctx, input)
return err
return ignoreNotFound(err)
}

// DescribeMountTargetsEfs describes an efs mount target
Expand Down Expand Up @@ -2071,6 +2071,7 @@ func IsAlreadyExistsError(err error) bool {
func IsNotFoundError(err error) bool {
if aerr, ok := err.(awserr.Error); ok && (aerr.Code() == elb.ErrCodeAccessPointNotFoundException ||
aerr.Code() == iam.ErrCodeNoSuchEntityException || aerr.Code() == "NatGatewayNotFound" ||
aerr.Code() == efs.ErrCodeFileSystemNotFound ||
strings.HasSuffix(aerr.Code(), ".NotFound")) {
return true
}
Expand Down

0 comments on commit 7cc4774

Please sign in to comment.