Supply daemon address/name on bootstrap/join#20
Merged
Conversation
This allows us to pass configurable Address/Names to a remote without having to set the certificate. This will be helpful for setting the initial address/name of the daemon. Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
In preparation for adding a configurable address/name to the daemon, this sets state.Address to a function, so we can ensure that the values are the same between the daemon and the state. Additionally adds `Name` to the state and daemon. 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>
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>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
…f state dir name Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
…ter_members db helpers 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>
stgraber
reviewed
Sep 21, 2022
stgraber
reviewed
Sep 21, 2022
Signed-off-by: Max Asnaashari <max.asnaashari@canonical.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the daemon would require a listen address to be supplied in order to start, and the value would not be stored anywhere. A restart would require specifying this address again.
Additionally, the cluster member name for each daemon was generated by its state directory name (for testing, mainly). This was problematic for scripting as each daemon would need a unique state directory name.
To solve both of these problems, this updates the MicroCluster daemon to accept a
nameandaddressargument upon bootstrapping or joining a cluster with a token. These values will then be saved in adaemon.yamlfile in the state directory.nameandaddressof the daemon, this adds a subtype toRemotecalledLocation(similar toLXD Cloud) that holds location information about the node we are dealing with. This does not includeCertificateso that we don't face issues unmarshalling an empty value.setDaemonConfighelper, on the daemon which will either insert a newdaemon.yamlif aLocationis supplied, or read the current config from the existing yaml.