mirror of
https://github.com/k3s-io/k3s.git
synced 2026-05-27 12:18:10 -04:00
* Add store tests with fixtures * Try connecting to local etcd first, if it is available * Handle panics from etcd backend code * Don't try to read WAL and restore v3 snapshots as they almost never exist Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
22 lines
338 B
Go
22 lines
338 B
Go
package fixtures
|
|
|
|
import (
|
|
"archive/zip"
|
|
"bytes"
|
|
_ "embed"
|
|
"io/fs"
|
|
|
|
"github.com/spf13/afero"
|
|
"github.com/spf13/afero/zipfs"
|
|
)
|
|
|
|
//go:embed etcd/member.zip
|
|
var member []byte
|
|
|
|
var ETCD fs.FS
|
|
|
|
func init() {
|
|
if r, err := zip.NewReader(bytes.NewReader(member), int64(len(member))); err == nil {
|
|
ETCD = afero.NewIOFS(zipfs.New(r))
|
|
}
|
|
}
|