-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into revert/105
- Loading branch information
Showing
32 changed files
with
726 additions
and
654 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
### Thank you for making MicroK8s better | ||
### Thank you for making K8s-dqlite better | ||
|
||
Please reference the issue this PR is fixing, or provide a description of the problem addressed. | ||
|
||
*Also verify you have:* | ||
|
||
* [ ] Read the [contributions](https://github.com/ubuntu/microk8s/blob/master/CONTRIBUTING.md) page. | ||
* [ ] Submitted the [CLA form](https://ubuntu.com/legal/contributors/agreement), if you are a first time contributor. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build !dqlite | ||
|
||
package cmd | ||
|
||
import "fmt" | ||
|
||
func printVersions() error { | ||
return fmt.Errorf("dqlite is not supported, compile with \"-tags dqlite\"") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//go:build dqlite | ||
|
||
package drivers_test | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
"testing" | ||
|
||
"github.com/canonical/go-dqlite/app" | ||
"github.com/canonical/k8s-dqlite/pkg/kine/drivers/dqlite" | ||
"github.com/canonical/k8s-dqlite/pkg/kine/drivers/generic" | ||
"github.com/canonical/k8s-dqlite/pkg/kine/server" | ||
) | ||
|
||
func TestDqliteCompaction(t *testing.T) { | ||
testCompaction(t, newDqliteBackend) | ||
} | ||
|
||
func BenchmarkDqliteCompaction(b *testing.B) { | ||
benchmarkCompaction(b, newDqliteBackend) | ||
} | ||
|
||
var ( | ||
nextIdx int | ||
) | ||
|
||
func newDqliteBackend(ctx context.Context, tb testing.TB) (server.Backend, *generic.Generic, error) { | ||
nextIdx++ | ||
|
||
dir := tb.TempDir() | ||
app, err := app.New(dir, app.WithAddress(fmt.Sprintf("127.0.0.1:%d", 59090+nextIdx))) | ||
if err != nil { | ||
panic(fmt.Errorf("failed to create dqlite app: %w", err)) | ||
} | ||
if err := app.Ready(ctx); err != nil { | ||
panic(fmt.Errorf("failed to initialize dqlite: %w", err)) | ||
} | ||
tb.Cleanup(func() { | ||
app.Close() | ||
}) | ||
|
||
return dqlite.NewVariant(ctx, fmt.Sprintf("dqlite://k8s-%d?driver-name=%s", nextIdx, app.Driver())) | ||
} |
Oops, something went wrong.