mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 21:39:36 +00:00
Move etcd ready channel into executor
This eliminates the final channel that was being passed around in an internal struct. The ETCD management code passes in a func that can be polled until etcd is ready; the executor is responsible for polling this after etcd is started and closing the etcd ready channel at the correct time. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
72bbd676f1
commit
d45006be66
@@ -30,7 +30,7 @@ func (e *Executor) APIServerHandlers(ctx context.Context) (authenticator.Request
|
||||
return nil, nil, errors.New("not implemented")
|
||||
}
|
||||
|
||||
func (e *Executor) APIServer(ctx context.Context, etcdReady <-chan struct{}, args []string) error {
|
||||
func (e *Executor) APIServer(ctx context.Context, args []string) error {
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ func (e *Executor) CurrentETCDOptions() (executor.InitialOptions, error) {
|
||||
return executor.InitialOptions{}, nil
|
||||
}
|
||||
|
||||
func (e *Executor) ETCD(ctx context.Context, args executor.ETCDConfig, extraArgs []string) error {
|
||||
func (e *Executor) ETCD(ctx context.Context, args *executor.ETCDConfig, extraArgs []string, test executor.TestFunc) error {
|
||||
embed := &executor.Embedded{}
|
||||
return embed.ETCD(ctx, args, extraArgs)
|
||||
return embed.ETCD(ctx, args, extraArgs, test)
|
||||
}
|
||||
|
||||
func (e *Executor) CloudControllerManager(ctx context.Context, ccmRBACReady <-chan struct{}, args []string) error {
|
||||
@@ -73,6 +73,12 @@ func (e *Executor) APIServerReadyChan() <-chan struct{} {
|
||||
return c
|
||||
}
|
||||
|
||||
func (e *Executor) ETCDReadyChan() <-chan struct{} {
|
||||
c := make(chan struct{})
|
||||
close(c)
|
||||
return c
|
||||
}
|
||||
|
||||
func (e *Executor) CRIReadyChan() <-chan struct{} {
|
||||
c := make(chan struct{})
|
||||
close(c)
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/k3s-io/k3s/pkg/daemons/config"
|
||||
"github.com/k3s-io/k3s/pkg/daemons/control/deps"
|
||||
"github.com/k3s-io/k3s/pkg/daemons/executor"
|
||||
"github.com/k3s-io/k3s/tests/mock"
|
||||
)
|
||||
|
||||
// GenerateDataDir creates a temporary directory at "/tmp/k3s/<RANDOM_STRING>/".
|
||||
|
||||
Reference in New Issue
Block a user