Skip to content

Init hook on bootstrap/join#15

Merged
stgraber merged 4 commits into
canonical:mainfrom
masnax:init-hook
Aug 24, 2022
Merged

Init hook on bootstrap/join#15
stgraber merged 4 commits into
canonical:mainfrom
masnax:init-hook

Conversation

@masnax
Copy link
Copy Markdown
Contributor

@masnax masnax commented Aug 24, 2022

Adds an init hook that can be passed to the daemon via microcluster.Start, which is run on a call to microcluster.NewCluster() (bootstrap) or microcluster.JoinCluster() (join)

The hook is of form func(state *state.State, bootstrap bool) error

@masnax masnax requested a review from stgraber August 24, 2022 19:53
@masnax masnax force-pushed the init-hook branch 2 times, most recently from 08ecc32 to 4d10ad2 Compare August 24, 2022 20:04
masnax added 4 commits August 24, 2022 20:11
This hook will be called on the first init (bootstrap or join).
Subsequent reloads of the daemon will ignore it.

Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
This flag will determine if we should run the init hook. It is currently
run on bootstrap and join, but not on reload.

Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
@stgraber stgraber merged commit 06297f4 into canonical:main Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants