You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
k3s/pkg/daemons/executor/etcd.go

34 lines
579 B

// +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() {
err := <-etcd.Err()
logrus.Fatalf("etcd exited: %v", err)
}()
return nil
}