Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
05d43278
Commit
05d43278
authored
Nov 23, 2021
by
Brad Davidson
Committed by
Brad Davidson
Dec 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump kine to v0.8.1
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
3b6a3fe9
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
4 deletions
+26
-4
go.mod
go.mod
+1
-1
go.sum
go.sum
+2
-2
generic.go
vendor/github.com/k3s-io/kine/pkg/drivers/generic/generic.go
+10
-0
sqlite.go
vendor/github.com/k3s-io/kine/pkg/drivers/sqlite/sqlite.go
+2
-0
sql.go
...or/github.com/k3s-io/kine/pkg/logstructured/sqllog/sql.go
+9
-0
types.go
vendor/github.com/k3s-io/kine/pkg/server/types.go
+1
-0
modules.txt
vendor/modules.txt
+1
-1
No files found.
go.mod
View file @
05d43278
...
...
@@ -92,7 +92,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/websocket v1.4.2
github.com/k3s-io/helm-controller v0.11.7
github.com/k3s-io/kine v0.8.
0
github.com/k3s-io/kine v0.8.
1
github.com/klauspost/compress v1.13.5
github.com/kubernetes-sigs/cri-tools v0.0.0-00010101000000-000000000000
github.com/lib/pq v1.10.2
...
...
go.sum
View file @
05d43278
...
...
@@ -572,8 +572,8 @@ github.com/k3s-io/etcd/server/v3 v3.5.0-k3s2 h1:yw8t2/k8Gwsv462XkEVawYGn5N+FI2xG
github.com/k3s-io/etcd/server/v3 v3.5.0-k3s2/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4=
github.com/k3s-io/helm-controller v0.11.7 h1:fNpBImB3h5aHvPf3zwU9sFWmeVQh0nTG1sLCoBhEeUg=
github.com/k3s-io/helm-controller v0.11.7/go.mod h1:z0ExsRRIkTO/QC//3/Esn5ItTD6AiQSluwzMaS7RI/4=
github.com/k3s-io/kine v0.8.
0 h1:k6T9bI9DID7lIbktukXxg1QfeFoAQK4EIvAHoyPAe0
8=
github.com/k3s-io/kine v0.8.
0
/go.mod h1:gaezUQ9c8iw8vxDV/DI8vc93h2rCpTvY37kMdYPMsyc=
github.com/k3s-io/kine v0.8.
1 h1:cuxZmENBUL5lvJORWGBjn87kKtIo8GK7o8H1hu+vd9
8=
github.com/k3s-io/kine v0.8.
1
/go.mod h1:gaezUQ9c8iw8vxDV/DI8vc93h2rCpTvY37kMdYPMsyc=
github.com/k3s-io/klog v1.0.0-k3s2 h1:yyvD2bQbxG7m85/pvNctLX2bUDmva5kOBvuZ77tTGBA=
github.com/k3s-io/klog v1.0.0-k3s2/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
github.com/k3s-io/klog/v2 v2.9.0-k3s2 h1:8Dzu3wGPFMo1mPEobSEpkHWH+HXqgFXp8R7FbcdgE8k=
...
...
vendor/github.com/k3s-io/kine/pkg/drivers/generic/generic.go
View file @
05d43278
...
...
@@ -94,6 +94,7 @@ type Generic struct {
DeleteSQL
string
CompactSQL
string
UpdateCompactSQL
string
PostCompactSQL
string
InsertSQL
string
FillSQL
string
InsertLastInsertIDSQL
string
...
...
@@ -297,6 +298,15 @@ func (d *Generic) Compact(ctx context.Context, revision int64) (int64, error) {
return
res
.
RowsAffected
()
}
func
(
d
*
Generic
)
PostCompact
(
ctx
context
.
Context
)
error
{
logrus
.
Trace
(
"POSTCOMPACT"
)
if
d
.
PostCompactSQL
!=
""
{
_
,
err
:=
d
.
execute
(
ctx
,
d
.
PostCompactSQL
)
return
err
}
return
nil
}
func
(
d
*
Generic
)
GetRevision
(
ctx
context
.
Context
,
revision
int64
)
(
*
sql
.
Rows
,
error
)
{
return
d
.
query
(
ctx
,
d
.
GetRevisionSQL
,
revision
)
}
...
...
vendor/github.com/k3s-io/kine/pkg/drivers/sqlite/sqlite.go
View file @
05d43278
...
...
@@ -39,6 +39,7 @@ var (
`CREATE INDEX IF NOT EXISTS kine_id_deleted_index ON kine (id,deleted)`
,
`CREATE INDEX IF NOT EXISTS kine_prev_revision_index ON kine (prev_revision)`
,
`CREATE UNIQUE INDEX IF NOT EXISTS kine_name_prev_revision_uindex ON kine (name, prev_revision)`
,
`PRAGMA wal_checkpoint(TRUNCATE)`
,
}
)
...
...
@@ -79,6 +80,7 @@ func NewVariant(ctx context.Context, driverName, dataSourceName string, connPool
kd.deleted != 0 AND
kd.id <= ?
)`
dialect
.
PostCompactSQL
=
`PRAGMA wal_checkpoint(FULL)`
dialect
.
TranslateErr
=
func
(
err
error
)
error
{
if
err
,
ok
:=
err
.
(
sqlite3
.
Error
);
ok
&&
err
.
ExtendedCode
==
sqlite3
.
ErrConstraintUnique
{
return
server
.
ErrKeyExists
...
...
vendor/github.com/k3s-io/kine/pkg/logstructured/sqllog/sql.go
View file @
05d43278
...
...
@@ -155,6 +155,10 @@ outer:
}
}
if
err
:=
s
.
postCompact
();
err
!=
nil
{
logrus
.
Errorf
(
"Post-compact operations failed: %v"
,
err
)
}
// Record the final results for the outer loop
compactRev
=
compactedRev
targetCompactRev
=
currentRev
...
...
@@ -218,6 +222,11 @@ func (s *SQLLog) compact(compactRev int64, targetCompactRev int64) (int64, int64
return
targetCompactRev
,
currentRev
,
nil
}
// postCompact executes any post-compact database cleanup - vacuuming, WAL truncate, etc.
func
(
s
*
SQLLog
)
postCompact
()
error
{
return
s
.
d
.
PostCompact
(
s
.
ctx
)
}
func
(
s
*
SQLLog
)
CurrentRevision
(
ctx
context
.
Context
)
(
int64
,
error
)
{
return
s
.
d
.
CurrentRevision
(
ctx
)
}
...
...
vendor/github.com/k3s-io/kine/pkg/server/types.go
View file @
05d43278
...
...
@@ -36,6 +36,7 @@ type Dialect interface {
GetCompactRevision
(
ctx
context
.
Context
)
(
int64
,
error
)
SetCompactRevision
(
ctx
context
.
Context
,
revision
int64
)
error
Compact
(
ctx
context
.
Context
,
revision
int64
)
(
int64
,
error
)
PostCompact
(
ctx
context
.
Context
)
error
Fill
(
ctx
context
.
Context
,
revision
int64
)
error
IsFill
(
key
string
)
bool
BeginTx
(
ctx
context
.
Context
,
opts
*
sql
.
TxOptions
)
(
Transaction
,
error
)
...
...
vendor/modules.txt
View file @
05d43278
...
...
@@ -746,7 +746,7 @@ github.com/k3s-io/helm-controller/pkg/apis/helm.cattle.io/v1
github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io
github.com/k3s-io/helm-controller/pkg/generated/controllers/helm.cattle.io/v1
github.com/k3s-io/helm-controller/pkg/helm
# github.com/k3s-io/kine v0.8.
0
# github.com/k3s-io/kine v0.8.
1
## explicit
github.com/k3s-io/kine/pkg/broadcaster
github.com/k3s-io/kine/pkg/client
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment