Skip to content

CLI: write network configuration#647

Merged
imobachgs merged 30 commits intoagama-project:masterfrom
imobachgs:cli-write-network
Jul 4, 2023
Merged

CLI: write network configuration#647
imobachgs merged 30 commits intoagama-project:masterfrom
imobachgs:cli-write-network

Conversation

@imobachgs
Copy link
Copy Markdown
Contributor

@imobachgs imobachgs commented Jul 4, 2023

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

  • Added (a few) unit tests
  • Tested manually

Future

We would like to implement a few changes, but we should address them separately.

  • Bound a connection to a specific network interface. By now, NetworkManager chooses the device automatically.
  • The software service might need to wait until the network is ready.
  • Do not update those connections that did not change.

@imobachgs imobachgs closed this Jul 4, 2023
@imobachgs imobachgs reopened this Jul 4, 2023
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 4, 2023

Coverage Status

coverage: 72.515% (-0.3%) from 72.829% when pulling 4c51e6a on imobachgs:cli-write-network into b566243 on openSUSE:master.

Copy link
Copy Markdown
Contributor

@joseivanlopez joseivanlopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@imobachgs imobachgs merged commit 62951e0 into agama-project:master Jul 4, 2023
@imobachgs imobachgs mentioned this pull request Aug 2, 2023
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.

3 participants