Introduction
The LXD team is very excited to announce the release of microcluster v2.1.0!
Microcluster is a Go library that simplifies development of dqlite clusters.
Changes
The PreBootstrap
hook is now deprecated, in favour of the new PreInit
hook.
The previous hook will continue to work, but may result in linter errors due to the deprecation warning (eg. from golangci-lint
). We recommend updating projects to utilize the new PreInit
hook instead.
-
It is not valid to define both the
PreInit
andPreBootstrap
hooks. This will result in an error. ThePreInit
hook is intended as a replacement for thePreBootstrap
hook, which will no longer be available fromv3.0.0
onwards. -
The new hook has a
bootstrap
flag.-
When the flag is set to true, the hook behaves exactly like the old
PreBootstrap
hook, executing the given code immediately after the system name and address have been loaded into the daemon, but before starting thedqlite
database during bootstrap. -
When the flag is set to false, the corresponding code will be executed on members joining an existing cluster in the same case as above: immediately after the system name and address have been loaded into the daemon, but before processing the join token with the existing cluster.
-
Importing Microcluster v2.1.0
go get -u github.com/canonical/microcluster/v2
Or if you haven’t yet added Microcluster to your list of dependencies run
go get github.com/canonical/microcluster/v2@latest