Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c32ea740
Unverified
Commit
c32ea740
authored
Feb 18, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74089 from deads2k/aggregator-error-handling
prevent unhandled errors on colliding poststarthook registration
parents
fcaa726e
8d0c56e2
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
11 deletions
+13
-11
apiserver.go
...k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go
+2
-2
config_test.go
staging/src/k8s.io/apiserver/pkg/server/config_test.go
+2
-2
hooks.go
staging/src/k8s.io/apiserver/pkg/server/hooks.go
+3
-1
serving_test.go
...g/src/k8s.io/apiserver/pkg/server/options/serving_test.go
+1
-1
apiserver.go
...ing/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go
+4
-4
start.go
staging/src/k8s.io/sample-apiserver/pkg/cmd/server/start.go
+1
-1
No files found.
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go
View file @
c32ea740
...
@@ -198,11 +198,11 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
...
@@ -198,11 +198,11 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
crdHandler
,
crdHandler
,
)
)
s
.
GenericAPIServer
.
AddPostStartHook
(
"start-apiextensions-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"start-apiextensions-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
Informers
.
Start
(
context
.
StopCh
)
s
.
Informers
.
Start
(
context
.
StopCh
)
return
nil
return
nil
})
})
s
.
GenericAPIServer
.
AddPostStartHook
(
"start-apiextensions-controllers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"start-apiextensions-controllers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
go
crdController
.
Run
(
context
.
StopCh
)
go
crdController
.
Run
(
context
.
StopCh
)
go
namingController
.
Run
(
context
.
StopCh
)
go
namingController
.
Run
(
context
.
StopCh
)
go
establishingController
.
Run
(
context
.
StopCh
)
go
establishingController
.
Run
(
context
.
StopCh
)
...
...
staging/src/k8s.io/apiserver/pkg/server/config_test.go
View file @
c32ea740
...
@@ -57,7 +57,7 @@ func TestNewWithDelegate(t *testing.T) {
...
@@ -57,7 +57,7 @@ func TestNewWithDelegate(t *testing.T) {
})
})
delegatePostStartHookChan
:=
make
(
chan
struct
{})
delegatePostStartHookChan
:=
make
(
chan
struct
{})
delegateServer
.
AddPostStartHook
(
"delegate-post-start-hook"
,
func
(
context
PostStartHookContext
)
error
{
delegateServer
.
AddPostStartHook
OrDie
(
"delegate-post-start-hook"
,
func
(
context
PostStartHookContext
)
error
{
defer
close
(
delegatePostStartHookChan
)
defer
close
(
delegatePostStartHookChan
)
return
nil
return
nil
})
})
...
@@ -85,7 +85,7 @@ func TestNewWithDelegate(t *testing.T) {
...
@@ -85,7 +85,7 @@ func TestNewWithDelegate(t *testing.T) {
})
})
wrappingPostStartHookChan
:=
make
(
chan
struct
{})
wrappingPostStartHookChan
:=
make
(
chan
struct
{})
wrappingServer
.
AddPostStartHook
(
"wrapping-post-start-hook"
,
func
(
context
PostStartHookContext
)
error
{
wrappingServer
.
AddPostStartHook
OrDie
(
"wrapping-post-start-hook"
,
func
(
context
PostStartHookContext
)
error
{
defer
close
(
wrappingPostStartHookChan
)
defer
close
(
wrappingPostStartHookChan
)
return
nil
return
nil
})
})
...
...
staging/src/k8s.io/apiserver/pkg/server/hooks.go
View file @
c32ea740
...
@@ -92,7 +92,9 @@ func (s *GenericAPIServer) AddPostStartHook(name string, hook PostStartHookFunc)
...
@@ -92,7 +92,9 @@ func (s *GenericAPIServer) AddPostStartHook(name string, hook PostStartHookFunc)
// done is closed when the poststarthook is finished. This is used by the health check to be able to indicate
// done is closed when the poststarthook is finished. This is used by the health check to be able to indicate
// that the poststarthook is finished
// that the poststarthook is finished
done
:=
make
(
chan
struct
{})
done
:=
make
(
chan
struct
{})
s
.
AddHealthzChecks
(
postStartHookHealthz
{
name
:
"poststarthook/"
+
name
,
done
:
done
})
if
err
:=
s
.
AddHealthzChecks
(
postStartHookHealthz
{
name
:
"poststarthook/"
+
name
,
done
:
done
});
err
!=
nil
{
return
err
}
s
.
postStartHooks
[
name
]
=
postStartHookEntry
{
hook
:
hook
,
done
:
done
}
s
.
postStartHooks
[
name
]
=
postStartHookEntry
{
hook
:
hook
,
done
:
done
}
return
nil
return
nil
...
...
staging/src/k8s.io/apiserver/pkg/server/options/serving_test.go
View file @
c32ea740
...
@@ -496,7 +496,7 @@ func TestServerRunWithSNI(t *testing.T) {
...
@@ -496,7 +496,7 @@ func TestServerRunWithSNI(t *testing.T) {
// add poststart hook to know when the server is up.
// add poststart hook to know when the server is up.
startedCh
:=
make
(
chan
struct
{})
startedCh
:=
make
(
chan
struct
{})
s
.
AddPostStartHook
(
"test-notifier"
,
func
(
context
PostStartHookContext
)
error
{
s
.
AddPostStartHook
OrDie
(
"test-notifier"
,
func
(
context
PostStartHookContext
)
error
{
close
(
startedCh
)
close
(
startedCh
)
return
nil
return
nil
})
})
...
...
staging/src/k8s.io/kube-aggregator/pkg/apiserver/apiserver.go
View file @
c32ea740
...
@@ -191,16 +191,16 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
...
@@ -191,16 +191,16 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
s
.
serviceResolver
,
s
.
serviceResolver
,
)
)
s
.
GenericAPIServer
.
AddPostStartHook
(
"start-kube-aggregator-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"start-kube-aggregator-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
informerFactory
.
Start
(
context
.
StopCh
)
informerFactory
.
Start
(
context
.
StopCh
)
c
.
GenericConfig
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
c
.
GenericConfig
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
return
nil
return
nil
})
})
s
.
GenericAPIServer
.
AddPostStartHook
(
"apiservice-registration-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"apiservice-registration-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
go
apiserviceRegistrationController
.
Run
(
context
.
StopCh
)
go
apiserviceRegistrationController
.
Run
(
context
.
StopCh
)
return
nil
return
nil
})
})
s
.
GenericAPIServer
.
AddPostStartHook
(
"apiservice-status-available-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"apiservice-status-available-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
// if we end up blocking for long periods of time, we may need to increase threadiness.
// if we end up blocking for long periods of time, we may need to increase threadiness.
go
availableController
.
Run
(
5
,
context
.
StopCh
)
go
availableController
.
Run
(
5
,
context
.
StopCh
)
return
nil
return
nil
...
@@ -219,7 +219,7 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
...
@@ -219,7 +219,7 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
}
}
s
.
openAPIAggregationController
=
openapicontroller
.
NewAggregationController
(
&
specDownloader
,
openAPIAggregator
)
s
.
openAPIAggregationController
=
openapicontroller
.
NewAggregationController
(
&
specDownloader
,
openAPIAggregator
)
s
.
GenericAPIServer
.
AddPostStartHook
(
"apiservice-openapi-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
s
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"apiservice-openapi-controller"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
go
s
.
openAPIAggregationController
.
Run
(
context
.
StopCh
)
go
s
.
openAPIAggregationController
.
Run
(
context
.
StopCh
)
return
nil
return
nil
})
})
...
...
staging/src/k8s.io/sample-apiserver/pkg/cmd/server/start.go
View file @
c32ea740
...
@@ -142,7 +142,7 @@ func (o WardleServerOptions) RunWardleServer(stopCh <-chan struct{}) error {
...
@@ -142,7 +142,7 @@ func (o WardleServerOptions) RunWardleServer(stopCh <-chan struct{}) error {
return
err
return
err
}
}
server
.
GenericAPIServer
.
AddPostStartHook
(
"start-sample-server-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
server
.
GenericAPIServer
.
AddPostStartHook
OrDie
(
"start-sample-server-informers"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
config
.
GenericConfig
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
config
.
GenericConfig
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
o
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
o
.
SharedInformerFactory
.
Start
(
context
.
StopCh
)
return
nil
return
nil
...
...
Write
Preview
Markdown
is supported
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