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
62c32fd0
Commit
62c32fd0
authored
Feb 25, 2019
by
David Eads
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRD server wait for CRDs to sync before reporting healthy
parent
81e7858e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
apiserver.go
...k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go
+9
-0
No files found.
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/apiserver.go
View file @
62c32fd0
...
@@ -37,6 +37,7 @@ import (
...
@@ -37,6 +37,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/version"
"k8s.io/apimachinery/pkg/version"
"k8s.io/apiserver/pkg/endpoints/discovery"
"k8s.io/apiserver/pkg/endpoints/discovery"
genericregistry
"k8s.io/apiserver/pkg/registry/generic"
genericregistry
"k8s.io/apiserver/pkg/registry/generic"
...
@@ -209,6 +210,14 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
...
@@ -209,6 +210,14 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
go
finalizingController
.
Run
(
5
,
context
.
StopCh
)
go
finalizingController
.
Run
(
5
,
context
.
StopCh
)
return
nil
return
nil
})
})
// we don't want to report healthy until we can handle all CRDs that have already been registered. Waiting for the informer
// to sync makes sure that the lister will be valid before we begin. There may still be races for CRDs added after startup,
// but we won't go healthy until we can handle the ones already present.
s
.
GenericAPIServer
.
AddPostStartHookOrDie
(
"crd-informer-synced"
,
func
(
context
genericapiserver
.
PostStartHookContext
)
error
{
return
wait
.
PollImmediateUntil
(
100
*
time
.
Millisecond
,
func
()
(
bool
,
error
)
{
return
s
.
Informers
.
Apiextensions
()
.
InternalVersion
()
.
CustomResourceDefinitions
()
.
Informer
()
.
HasSynced
(),
nil
},
context
.
StopCh
)
})
return
s
,
nil
return
s
,
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