mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Update vendor for kine fix
This commit is contained in:
parent
96afc5fde4
commit
1004f5b0be
2
go.mod
2
go.mod
@ -99,7 +99,7 @@ require (
|
||||
github.com/rakelkar/gonetsh v0.0.0-20190719023240-501daadcadf8 // indirect
|
||||
github.com/rancher/dynamiclistener v0.2.0
|
||||
github.com/rancher/helm-controller v0.3.0
|
||||
github.com/rancher/kine v0.3.1
|
||||
github.com/rancher/kine v0.3.2
|
||||
github.com/rancher/remotedialer v0.2.0
|
||||
github.com/rancher/wrangler v0.4.0
|
||||
github.com/rancher/wrangler-api v0.4.0
|
||||
|
4
go.sum
4
go.sum
@ -743,8 +743,8 @@ github.com/rancher/flannel v0.11.0-k3s.1 h1:mIwnfWDafjzQgFkZeJ1AkFrrAT3EdBaA1giE
|
||||
github.com/rancher/flannel v0.11.0-k3s.1/go.mod h1:Hn4ZV+eq0LhLZP63xZnxdGwXEoRSxs5sxELxu27M3UA=
|
||||
github.com/rancher/helm-controller v0.3.0 h1:sYRpOiJc4+NmSEkft3lR2pwaEPOrPzZOTo2UjFnVF4I=
|
||||
github.com/rancher/helm-controller v0.3.0/go.mod h1:194LHuZRrxcD82bG1rJtOWsw98U4JbPhDWqvL7l3PAw=
|
||||
github.com/rancher/kine v0.3.1 h1:gwfKz/KoyZG7Dyo/eKYb3eAKne6eSmQKE0etHTrGLLk=
|
||||
github.com/rancher/kine v0.3.1/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ=
|
||||
github.com/rancher/kine v0.3.2 h1:2kP48ojBWVoZ6vlzixc9jc9uKRk7Yn1a7kWoOsJi7Sg=
|
||||
github.com/rancher/kine v0.3.2/go.mod h1:xEMl0tLCva9/9me7mXJ3m9Vo6yqHgC4OU3NiK4CPrGQ=
|
||||
github.com/rancher/kubernetes v1.17.0-k3s.1 h1:g1xvTHOHMJxwWtseblor0gighLRHpL7Bf9MwX8HR3W0=
|
||||
github.com/rancher/kubernetes v1.17.0-k3s.1/go.mod h1:NbNV+69yL3eKiKDJ+ZEjqOplN3BFXKBeunzkoOy8WLo=
|
||||
github.com/rancher/kubernetes/staging/src/k8s.io/api v1.17.0-k3s.1 h1:L2mS7D+Kv/0ZUg9uJZcPfKuDCYcKOTprTQsK35i2hFg=
|
||||
|
21
vendor/github.com/rancher/kine/pkg/client/client.go
generated
vendored
21
vendor/github.com/rancher/kine/pkg/client/client.go
generated
vendored
@ -11,6 +11,7 @@ import (
|
||||
)
|
||||
|
||||
type Value struct {
|
||||
Key []byte
|
||||
Data []byte
|
||||
Modified int64
|
||||
}
|
||||
@ -20,6 +21,7 @@ var (
|
||||
)
|
||||
|
||||
type Client interface {
|
||||
List(ctx context.Context, key string, rev int) ([]Value, error)
|
||||
Get(ctx context.Context, key string) (Value, error)
|
||||
Put(ctx context.Context, key string, value []byte) error
|
||||
Create(ctx context.Context, key string, value []byte) error
|
||||
@ -51,6 +53,24 @@ func New(config endpoint.ETCDConfig) (Client, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *client) List(ctx context.Context, key string, rev int) ([]Value, error) {
|
||||
resp, err := c.c.Get(ctx, key, clientv3.WithPrefix(), clientv3.WithRev(int64(rev)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var vals []Value
|
||||
for _, kv := range resp.Kvs {
|
||||
vals = append(vals, Value{
|
||||
Key: kv.Key,
|
||||
Data: kv.Value,
|
||||
Modified: kv.ModRevision,
|
||||
})
|
||||
}
|
||||
|
||||
return vals, nil
|
||||
}
|
||||
|
||||
func (c *client) Get(ctx context.Context, key string) (Value, error) {
|
||||
resp, err := c.c.Get(ctx, key)
|
||||
if err != nil {
|
||||
@ -59,6 +79,7 @@ func (c *client) Get(ctx context.Context, key string) (Value, error) {
|
||||
|
||||
if len(resp.Kvs) == 1 {
|
||||
return Value{
|
||||
Key: resp.Kvs[0].Key,
|
||||
Data: resp.Kvs[0].Value,
|
||||
Modified: resp.Kvs[0].ModRevision,
|
||||
}, nil
|
||||
|
8
vendor/github.com/rancher/kine/pkg/logstructured/sqllog/sql.go
generated
vendored
8
vendor/github.com/rancher/kine/pkg/logstructured/sqllog/sql.go
generated
vendored
@ -172,8 +172,16 @@ func (s *SQLLog) List(ctx context.Context, prefix, startKey string, limit, revis
|
||||
err error
|
||||
)
|
||||
|
||||
// It's assumed that when there is a start key that that key exists.
|
||||
if strings.HasSuffix(prefix, "/") {
|
||||
// In the situation of a list start the startKey will not exist so set to ""
|
||||
if prefix == startKey {
|
||||
startKey = ""
|
||||
}
|
||||
prefix += "%"
|
||||
} else {
|
||||
// Also if this isn't a list there is no reason to pass startKey
|
||||
startKey = ""
|
||||
}
|
||||
|
||||
if revision == 0 {
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@ -725,7 +725,7 @@ github.com/rancher/helm-controller/pkg/generated/informers/externalversions/helm
|
||||
github.com/rancher/helm-controller/pkg/generated/informers/externalversions/internalinterfaces
|
||||
github.com/rancher/helm-controller/pkg/generated/listers/helm.cattle.io/v1
|
||||
github.com/rancher/helm-controller/pkg/helm
|
||||
# github.com/rancher/kine v0.3.1
|
||||
# github.com/rancher/kine v0.3.2
|
||||
github.com/rancher/kine/pkg/broadcaster
|
||||
github.com/rancher/kine/pkg/client
|
||||
github.com/rancher/kine/pkg/drivers/dqlite
|
||||
|
Loading…
Reference in New Issue
Block a user