-
Notifications
You must be signed in to change notification settings - Fork 20
/
sks.go
46 lines (38 loc) · 1.23 KB
/
sks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package cmd
import (
"fmt"
"os"
"time"
"github.com/spf13/cobra"
"github.com/exoscale/cli/pkg/globalstate"
)
var sksCmd = &cobra.Command{
Use: "sks",
Short: "Scalable Kubernetes Service management",
PersistentPreRun: func(_ *cobra.Command, _ []string) {
// Some SKS operations can take a long time, raising
// the Exoscale API client timeout as a precaution.
globalstate.EgoscaleClient.Client.SetTimeout(10 * time.Minute)
},
}
var deprecatedSKSCmd = &cobra.Command{
Use: "sks",
Short: "Scalable Kubernetes Service management",
PersistentPreRun: func(_ *cobra.Command, _ []string) {
// Some SKS operations can take a long time, raising
// the Exoscale API client timeout as a precaution.
globalstate.EgoscaleClient.Client.SetTimeout(10 * time.Minute)
fmt.Fprintln(os.Stderr,
`**********************************************************************
The "exo sks" commands are deprecated and will be removed in a future
version, please use "exo compute sks" replacement commands.
**********************************************************************`)
time.Sleep(3 * time.Second)
},
Hidden: true,
}
func init() {
computeCmd.AddCommand(sksCmd)
// FIXME: remove this someday.
RootCmd.AddCommand(deprecatedSKSCmd)
}