Skip to content

Commit 4a779ef

Browse files
committed
feat: add DevSpace sleep mode handling
2 parents a13be58 + 14131de commit 4a779ef

28 files changed

Lines changed: 98 additions & 66 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ jobs:
1717
name: lint
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
21-
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v2
20+
- uses: actions/setup-go@v3
21+
with:
22+
go-version: 1.18
23+
- uses: actions/checkout@v3
24+
- name: Run golangci-lint
25+
uses: golangci/golangci-lint-action@v3.2.0
2326
with:
24-
version: v1.45.2
2527
args:
2628
-v
2729
--config=.golangci.yml

.vscode/launch.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"name": "Debug cli",
6+
"type": "go",
7+
"request": "launch",
8+
"mode": "debug",
9+
"program": "${workspaceRoot}/main.go",
10+
"cwd": "${workspaceRoot}",
11+
"args": ["dev"],
12+
"env": {
13+
"DEVSPACE_CONFIG": "devspace.yaml"
14+
}
15+
},
416
{
517
"name": "Launch e2e tests",
618
"type": "go",

cmd/analyze.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (cmd *AnalyzeCmd) RunAnalyze(f factory.Factory, cobraCmd *cobra.Command, ar
8686

8787
// If the current kube context or namespace is different from old,
8888
// show warnings and reset kube client if necessary
89-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, log)
89+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, log)
9090
if err != nil {
9191
return err
9292
}

cmd/attach.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func (cmd *AttachCmd) Run(f factory.Factory, cobraCmd *cobra.Command, args []str
8989

9090
// If the current kube context or namespace is different from old,
9191
// show warnings and reset kube client if necessary
92-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, log)
92+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, log)
9393
if err != nil {
9494
return err
9595
}

cmd/enter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (cmd *EnterCmd) Run(f factory.Factory, args []string) error {
118118

119119
// If the current kube context or namespace is different from old,
120120
// show warnings and reset kube client if necessary
121-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, logger)
121+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, logger)
122122
if err != nil {
123123
return err
124124
}

cmd/list/deployments.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (cmd *deploymentsCmd) RunDeploymentsStatus(f factory.Factory, cobraCmd *cob
8080

8181
// If the current kube context or namespace is different from old,
8282
// show warnings and reset kube client if necessary
83-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, logger)
83+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, logger)
8484
if err != nil {
8585
return err
8686
}

cmd/list/namespaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (cmd *namespacesCmd) RunListNamespaces(f factory.Factory, cobraCmd *cobra.C
7171

7272
// If the current kube context or namespace is different from old,
7373
// show warnings and reset kube client if necessary
74-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, logger)
74+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, logger)
7575
if err != nil {
7676
return err
7777
}

cmd/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (cmd *LogsCmd) RunLogs(f factory.Factory) error {
106106

107107
// If the current kube context or namespace is different from old,
108108
// show warnings and reset kube client if necessary
109-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, log)
109+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, log)
110110
if err != nil {
111111
return err
112112
}

cmd/open.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func (cmd *OpenCmd) RunOpen(f factory.Factory) error {
128128

129129
// If the current kube context or namespace is different from old,
130130
// show warnings and reset kube client if necessary
131-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, cmd.log)
131+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, cmd.log)
132132
if err != nil {
133133
return err
134134
}

cmd/reset/pods.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (cmd *podsCmd) RunResetPods(f factory.Factory, cobraCmd *cobra.Command, arg
8282

8383
// If the current kube context or namespace is different from old,
8484
// show warnings and reset kube client if necessary
85-
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, cmd.log)
85+
client, err = kubectl.CheckKubeContext(client, localCache, cmd.NoWarn, cmd.SwitchContext, false, cmd.log)
8686
if err != nil {
8787
return err
8888
}

0 commit comments

Comments
 (0)