Skip to content

Commit 063ac44

Browse files
committed
fix unpausing schedule
1 parent a68ac1d commit 063ac44

File tree

5 files changed

+25
-6
lines changed

5 files changed

+25
-6
lines changed

cmd/instance/instance_vnc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Duration follows Go's duration format (e.g. "30m", "1h", "24h")`,
5050
}
5151

5252
// Enable VNC for the instance with optional duration
53-
var vnc civogo.InstanceVnc
53+
var vnc civogo.CreateInstanceVncResp
5454
if duration != "" {
5555
vnc, err = client.GetInstanceVnc(instance.ID, duration)
5656
} else {

cmd/snapshot/snapshot_schedule_update.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
var scheduleName string
15-
var pauseSchedule bool
15+
var schedulePaused string
1616

1717
var snapshotScheduleUpdateCmd = &cobra.Command{
1818
Use: "update [ID/NAME]",
@@ -32,6 +32,19 @@ var snapshotScheduleUpdateCmd = &cobra.Command{
3232
os.Exit(1)
3333
}
3434

35+
var pauseSchedule *bool
36+
switch schedulePaused {
37+
case "true", "yes":
38+
pauseSchedule = utility.Ptr(true)
39+
case "false", "no":
40+
pauseSchedule = utility.Ptr(false)
41+
case "":
42+
pauseSchedule = nil
43+
default:
44+
utility.Error("Invalid value for -paused, please use true/false values.")
45+
os.Exit(1)
46+
}
47+
3548
config := &civogo.UpdateSnapshotScheduleRequest{
3649
Name: scheduleName,
3750
Description: scheduleDescription,
@@ -63,5 +76,5 @@ var snapshotScheduleUpdateCmd = &cobra.Command{
6376
func init() {
6477
snapshotScheduleUpdateCmd.Flags().StringVarP(&scheduleName, "name", "n", "", "New name for the snapshot schedule")
6578
snapshotScheduleUpdateCmd.Flags().StringVarP(&scheduleDescription, "description", "d", "", "New description for the snapshot schedule")
66-
snapshotScheduleUpdateCmd.Flags().BoolVarP(&pauseSchedule, "pause", "p", false, "Pause the snapshot schedule")
79+
snapshotScheduleUpdateCmd.Flags().StringVarP(&schedulePaused, "paused", "p", "", "Whether to pause the snapshot schedule (use 'true' and 'false')")
6780
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/adhocore/gronx v1.19.5
88
github.com/alejandrojnm/go-pluralize v0.1.0
99
github.com/briandowns/spinner v1.23.2
10-
github.com/civo/civogo v0.5.5-0.20250610060405-87a6b41ae40f
10+
github.com/civo/civogo v0.6.1
1111
github.com/google/go-github/v57 v57.0.0
1212
github.com/google/uuid v1.6.0
1313
github.com/gookit/color v1.5.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ github.com/c4milo/unpackit v0.0.0-20170704181138-4ed373e9ef1c h1:aprLqMn7gSPT+vd
3030
github.com/c4milo/unpackit v0.0.0-20170704181138-4ed373e9ef1c/go.mod h1:Ie6SubJv/NTO9Q0UBH0QCl3Ve50lu9hjbi5YJUw03TE=
3131
github.com/chengxilo/virtualterm v1.0.4 h1:Z6IpERbRVlfB8WkOmtbHiDbBANU7cimRIof7mk9/PwM=
3232
github.com/chengxilo/virtualterm v1.0.4/go.mod h1:DyxxBZz/x1iqJjFxTFcr6/x+jSpqN0iwWCOK1q10rlY=
33-
github.com/civo/civogo v0.5.5-0.20250610060405-87a6b41ae40f h1:Vsqz7nBl6a5moKkmv4pAjnmdYnMyR4U10e7vm6Ij4Hs=
34-
github.com/civo/civogo v0.5.5-0.20250610060405-87a6b41ae40f/go.mod h1:LaEbkszc+9nXSh4YNG0sYXFGYqdQFmXXzQg0gESs2hc=
33+
github.com/civo/civogo v0.6.1 h1:PFOh7rBU0vmj7LTDIv3z7l9uXG4SZyyzScCl3wyTFSc=
34+
github.com/civo/civogo v0.6.1/go.mod h1:LaEbkszc+9nXSh4YNG0sYXFGYqdQFmXXzQg0gESs2hc=
3535
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
3636
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ=
3737
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk=

utility/ptr.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package utility
2+
3+
// Ptr returns a pointer to the provided value.
4+
func Ptr[T any](v T) *T {
5+
return &v
6+
}

0 commit comments

Comments
 (0)