Skip to content

Commit

Permalink
add option to enable/disable remount on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
pmenglund committed Oct 2, 2023
1 parent 0d5f678 commit 9df63c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions option/virtual_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ func WithNoMountRefresh() VirtualInstanceOption {
}
}

// WithRemountOnResume sets remount on Virtual Instance resume.
func WithRemountOnResume(remount bool) VirtualInstanceOption {
return func(o *VirtualInstanceOptions) {
o.EnableRemountOnResume = &remount
}
}

// WithAutoSuspend duration without queries after which the virtual instance is suspended. Minimum time is 15 minutes.
func WithAutoSuspend(d time.Duration) VirtualInstanceOption {
return func(o *VirtualInstanceOptions) {
Expand Down
1 change: 1 addition & 0 deletions virtual_instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func (s *VirtualInstanceIntegrationSuite) TestVirtualInstance_0_Create() {
vi, err := rc.CreateVirtualInstance(ctx, s.name,
option.WithVirtualInstanceSize(option.SizeSmall),
option.WithNoMountRefresh(),
option.WithRemountOnResume(true),
option.WithAutoSuspend(15*time.Minute),
)
s.Require().NoError(err)
Expand Down

0 comments on commit 9df63c1

Please sign in to comment.