Skip to content

Commit

Permalink
AWS EFS error helpers (#6061)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Memisoglu authored and Ilya Kislenko committed Jul 16, 2019
1 parent a4edce1 commit a17d148
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions pkg/blockstorage/awsefs/error.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package awsefs

import (
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/backup"
awsefs "github.com/aws/aws-sdk-go/service/efs"
)

func isVolumeNotFound(err error) bool {
if awsErr, ok := err.(awserr.Error); ok {
return awsErr.Code() == awsefs.ErrCodeFileSystemNotFound
}
return false
}

func isBackupVaultAlreadyExists(err error) bool {
if awsErr, ok := err.(awserr.Error); ok {
return awsErr.Code() == backup.ErrCodeAlreadyExistsException
}
return false
}

func isRecoveryPointNotFound(err error) bool {
if awsErr, ok := err.(awserr.Error); ok {
return awsErr.Code() == backup.ErrCodeResourceNotFoundException
}
return false
}

0 comments on commit a17d148

Please sign in to comment.