-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Overview Implements VolumeCreate for EFS * Defines constants for throughput and performance modes for EFS * Waiting method for the created EFS volume to be available
- Loading branch information
Hakan Memisoglu
committed
Jul 29, 2019
1 parent
1356242
commit 906d4cb
Showing
4 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package awsefs | ||
|
||
import ( | ||
"context" | ||
|
||
awsefs "github.com/aws/aws-sdk-go/service/efs" | ||
|
||
"github.com/kanisterio/kanister/pkg/poll" | ||
) | ||
|
||
const ( | ||
maxNumErrorRetries = 3 | ||
) | ||
|
||
func (e *efs) waitUntilFileSystemAvailable(ctx context.Context, id string) error { | ||
return poll.WaitWithRetries(ctx, maxNumErrorRetries, poll.IsAlwaysRetryable, func(ctx context.Context) (bool, error) { | ||
req := &awsefs.DescribeFileSystemsInput{} | ||
req.SetFileSystemId(id) | ||
|
||
desc, err := e.DescribeFileSystemsWithContext(ctx, req) | ||
if err != nil { | ||
return false, err | ||
} | ||
if len(desc.FileSystems) == 0 { | ||
return false, nil | ||
} | ||
state := desc.FileSystems[0].LifeCycleState | ||
if state == nil { | ||
return false, nil | ||
} | ||
return *state == awsefs.LifeCycleStateAvailable, nil | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters