Skip to content

Commit

Permalink
UPSTREAM: <carry>: expose HasBeenReady lifecycle signal
Browse files Browse the repository at this point in the history
  • Loading branch information
p0lyn0mial committed Sep 14, 2021
1 parent 36aafa9 commit 346f46b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions staging/src/k8s.io/apiserver/pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ func (c *Config) AddPostStartHookOrDie(name string, hook PostStartHookFunc) {
}
}

// HasBeenReadySignal exposes a server's lifecycle signal which is signaled when the readyz endpoint succeeds for the first time.
func (c *Config) HasBeenReadySignal() <-chan struct{} {
return c.hasBeenReadyCh
}

// Complete fills in any fields not set that are required to have valid data and can be derived
// from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.
func (c *Config) Complete(informers informers.SharedInformerFactory) CompletedConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (c completedConfig) NewWithDelegate(delegationTarget genericapiserver.Deleg
(func() ([]byte, []byte))(s.proxyCurrentCertKeyContent),
s.serviceResolver,
c.GenericConfig.EgressSelector,
c.GenericConfig.LifecycleSignals.HasBeenReady.Signaled(),
c.GenericConfig.HasBeenReadySignal(),
)
if err != nil {
return nil, err
Expand Down

0 comments on commit 346f46b

Please sign in to comment.