File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1
- 1.4.2
1
+ 1.4.3
Original file line number Diff line number Diff line change 8
8
log "github.com/sirupsen/logrus"
9
9
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
10
10
kubeConfig "k8s.io/client-go/kubernetes"
11
+ "k8s.io/client-go/rest"
11
12
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
12
13
"k8s.io/client-go/tools/clientcmd"
13
14
"k8s.io/client-go/tools/clientcmd/api"
@@ -55,7 +56,12 @@ func goOverContext(options *getOverContextOptions) error {
55
56
if e != nil {
56
57
message := fmt .Sprintf ("Failed to create config with error:\n %s" , e )
57
58
options .logger .Warn (message )
58
- return e
59
+ clientCnf , e = rest .InClusterConfig ()
60
+ if e != nil {
61
+ message = fmt .Sprintf ("Failed to create in cluster config with error:\n %s" , e )
62
+ options .logger .Warn (message )
63
+ return e
64
+ }
59
65
}
60
66
options .logger .Info ("Created config for context" )
61
67
host = clientCnf .Host
@@ -65,6 +71,7 @@ func goOverContext(options *getOverContextOptions) error {
65
71
if e != nil {
66
72
message := fmt .Sprintf ("Failed to create kubernetes client with error:\n %s" , e )
67
73
options .logger .Warn (message )
74
+
68
75
return e
69
76
}
70
77
options .logger .Info ("Created client set for context" )
You can’t perform that action at this time.
0 commit comments