Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Rainbond2
Commits
289bb34e
Commit
289bb34e
authored
6 years ago
by
GLYASAI
Browse files
Options
Download
Email Patches
Plain Diff
[Fix] fix bug: unable to proxy kubeapi
parent
149fded1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gateway/controller/controller.go
+4
-4
gateway/controller/controller.go
gateway/controller/util.go
+8
-0
gateway/controller/util.go
with
12 additions
and
4 deletions
+12
-4
gateway/controller/controller.go
+
4
-
4
View file @
289bb34e
...
...
@@ -78,15 +78,15 @@ type GWController struct {
// Start starts Gateway
func
(
gwc
*
GWController
)
Start
(
errCh
chan
error
)
error
{
if
gwc
.
ocfg
.
EnableRbdEndpoints
{
go
gwc
.
initRbdEndpoints
(
errCh
)
}
// start plugin(eg: nginx, zeus and etc)
gwc
.
GWS
.
Start
(
errCh
)
// start informer
gwc
.
store
.
Run
(
gwc
.
stopCh
)
if
gwc
.
ocfg
.
EnableRbdEndpoints
{
go
gwc
.
initRbdEndpoints
(
errCh
)
}
// start task queue
go
gwc
.
syncQueue
.
Run
(
1
*
time
.
Second
,
gwc
.
stopCh
)
...
...
This diff is collapsed.
Click to expand it.
gateway/controller/util.go
+
8
-
0
View file @
289bb34e
...
...
@@ -4,8 +4,10 @@ import (
"github.com/Sirupsen/logrus"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
// NewClientSet returns a new kubernetes clientSet
func
NewClientSet
(
kubeconfig
string
)
(
*
kubernetes
.
Clientset
,
error
)
{
conf
,
err
:=
clientcmd
.
BuildConfigFromFlags
(
""
,
kubeconfig
)
if
err
!=
nil
{
...
...
@@ -17,6 +19,12 @@ func NewClientSet(kubeconfig string) (*kubernetes.Clientset, error) {
if
err
!=
nil
{
return
nil
,
err
}
_
,
err
=
clientSet
.
CoreV1
()
.
Namespaces
()
.
List
(
v1
.
ListOptions
{})
if
err
!=
nil
{
return
nil
,
err
}
logrus
.
Debug
(
"Kube client api create success."
)
return
clientSet
,
nil
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help