-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2 & lxd, k8s-dqlite v1.3.0 #797
Conversation
e510bbf
to
5838fe1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot @louiseschmidtgen! LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, left some comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to wait and be updated once canonical/microcluster#290 is released (beginning of December).
This basically means we don't need microcluster v3 anymore but can pin the v2 LTS
5473dd5
to
9110a74
Compare
9110a74
to
0e4cd5c
Compare
@@ -31,8 +31,12 @@ func (e *Endpoints) postClusterBootstrap(_ state.State, r *http.Request) respons | |||
} | |||
|
|||
// Check if the cluster is already bootstrapped | |||
_, err = e.provider.MicroCluster().Status(r.Context()) | |||
if err == nil { | |||
status, err := e.provider.MicroCluster().Status(r.Context()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had a bug in main here:
_, err = e.provider.MicroCluster().Status(r.Context()) |
That version uses microcluster v3. This version contained a bug that was fixed in a later version
We silenced that issue here:
k8s-snap/src/k8s/pkg/k8sd/api/cluster_bootstrap.go
Lines 33 to 34 in 0e4cd5c
// Check if the cluster is already bootstrapped | |
_, err = e.provider.MicroCluster().Status(r.Context()) |
Instead of checking for the error we need to check for status.ready from that function.
Interestingly, this issue popped now up in v2 because the bugfix was backported with https://github.com/canonical/microcluster/pull/265/files and therefore no error was thrown anymore, causing the cluster falsely to claim that it is already bootstrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find @bschimke95! Thanks for resolving this bug.
@@ -23,8 +23,13 @@ func (e *Endpoints) postClusterJoin(s state.State, r *http.Request) response.Res | |||
if err != nil { | |||
return response.BadRequest(fmt.Errorf("invalid hostname %q: %w", req.Name, err)) | |||
} | |||
// Check if the cluster is already bootstrapped | |||
status, err := e.provider.MicroCluster().Status(r.Context()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I can't approve the PR since I've created it.
@@ -31,8 +31,12 @@ func (e *Endpoints) postClusterBootstrap(_ state.State, r *http.Request) respons | |||
} | |||
|
|||
// Check if the cluster is already bootstrapped | |||
_, err = e.provider.MicroCluster().Status(r.Context()) | |||
if err == nil { | |||
status, err := e.provider.MicroCluster().Status(r.Context()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find @bschimke95! Thanks for resolving this bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Dqlite v1.17.1 LTS, go-dqlite v2, Microcluster v2 & lxd, k8s-dqlite v1.3.0
Use the new Dqlite LTS v1.17.1 and go-dqlite v2.
Microcluster v2 (LTS) will have a fix backported for us (joining issues with names by enabling us to add extra sans). Consequently, the lxd version is adjusted to support v2 of microcluster.
This PR updates the k8s-dqlite version from
v1.2.0
tov1.3.0
which uses Dqlite v1.17.1 LTS and go-dqlite v2.Release notes: https://github.com/canonical/k8s-dqlite/releases/tag/v1.3.0