File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 5
5
package main
6
6
7
7
import (
8
- "log "
8
+ "fmt "
9
9
"os"
10
10
"path/filepath"
11
11
"text/template"
@@ -19,7 +19,7 @@ const (
19
19
defaultformat = "{{.Context}}" + defaultSepalater + "{{.Namespace}}"
20
20
)
21
21
22
- type currentContext struct {
22
+ type kubeContext struct {
23
23
Context string
24
24
Namespace string
25
25
}
@@ -31,10 +31,10 @@ func main() {
31
31
32
32
config , err := kubeConfig .RawConfig ()
33
33
if err != nil {
34
- os . Exit ( 1 )
34
+ fmt . Fprintln ( os . Stdout , "could not get kubeconfig" )
35
35
}
36
36
if len (config .Contexts ) == 0 {
37
- log . Fatal ( "empty context in kubeconfig " )
37
+ fmt . Fprintln ( os . Stdout , "kubeconfig is empty context " )
38
38
}
39
39
40
40
curCtx := config .CurrentContext
@@ -48,9 +48,9 @@ func main() {
48
48
format = os .Args [1 ]
49
49
}
50
50
51
- cctx := currentContext {
51
+ kctx := kubeContext {
52
52
Context : curCtx ,
53
53
Namespace : curNs ,
54
54
}
55
- template .Must (template .New ("tmux" ).Parse (format )).Execute (os .Stdout , cctx )
55
+ template .Must (template .New ("kube- tmux" ).Parse (format )).Execute (os .Stdout , kctx )
56
56
}
You can’t perform that action at this time.
0 commit comments