CLI: write network configuration#647
Merged
imobachgs merged 30 commits intoagama-project:masterfrom Jul 4, 2023
imobachgs:cli-write-network
Merged
CLI: write network configuration#647imobachgs merged 30 commits intoagama-project:masterfrom imobachgs:cli-write-network
imobachgs merged 30 commits intoagama-project:masterfrom
imobachgs:cli-write-network
Conversation
* Do not send the "dns" key as it takes precedence over "dns-data".
* Only the name (Id) and the method are supported.
Merged
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.
Problem
#622 added support to display the network configuration through the CLI:
agama config show. However, writing the configuration was still missing.Trello card: https://trello.com/c/vVe8CboU/3354-8-agama-set-the-network-configuration-using-a-jsonnet-file
Solution
This PR implements support to set the network configuration using the CLI. But, as usual, we took the chance to do some refactoring and clean-up.
Note: naming network connections
Agama's network service API works with connection names (Id) instead of UUIDs. In NetworkManager, you can use any of them. However, we prefer our users to work with Ids, not UUIDs, because they are more human-readable. The problem is that, in NetworkManager, the Id is not unique.
This PR modifies Agama to rename duplicated network connections. For instance, if we have multiple connections with the same name (e.g.,
virbr0), Agama will add a suffix to the duplicates (e.g.,virbr0-1,virbr0-2, etc.).Testing
Future
We would like to implement a few changes, but we should address them separately.