mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
de18528412
* Set etcd timeouts using values from k8s instead of etcdctl Fix for one of the warnings from #2303 * Use etcd zap logger instead of deprecated capsnlog Fix for one of the warnings from #2303 * Remove member self-promotion code paths * Add learner promotion tracking code * Fix RaftAppliedIndex progress check * Remove ErrGRPCKeyNotFound check This is not used by v3 API - it just returns a response with 0 KVs. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
38 lines
775 B
Go
38 lines
775 B
Go
// +build !no_embedded_executor
|
|
|
|
package executor
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"go.etcd.io/etcd/embed"
|
|
)
|
|
|
|
func (e Embedded) CurrentETCDOptions() (InitialOptions, error) {
|
|
return InitialOptions{}, nil
|
|
}
|
|
|
|
func (e Embedded) ETCD(args ETCDConfig) error {
|
|
configFile, err := args.ToConfigFile()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
cfg, err := embed.ConfigFromFile(configFile)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
etcd, err := embed.StartEtcd(cfg)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
|
|
go func() {
|
|
select {
|
|
case <-etcd.Server.StopNotify():
|
|
logrus.Fatalf("etcd stopped - if this node was removed from the cluster, you must backup and delete %s before rejoining", args.DataDir)
|
|
case err := <-etcd.Err():
|
|
logrus.Fatalf("etcd exited: %v", err)
|
|
}
|
|
}()
|
|
return nil
|
|
}
|