forked from nmstate/nmstate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apply: Support overriding interface configuration without merging
When using `nmstatectl gc`, unmentioned IP section means disabled, but in `nmstatectl service` or `nmstatectl apply`, unmentioned IP means merging from current. In order to be consistent when migrating from `nmstatectl gc` to `nmstatectl service`, we need to introduce a option to skip merging IP. We also have user request us to not merging existing route by only apply route found in desired state. So we introduce option to skip merging current state: * Rust: `NetworkState.set_override_iface(true)` * Python: `libnmstate.apply(state, override_iface=True)` * C: `nmstate_net_state_apply()` with `NMSTATE_FLAG_OVERRIDE_IFACE` flag. * CLI: `nmstatectl apply --override-iface <state_file>` * nmstate.service: `/etc/nmstate/nmstate.conf` with: ```toml [service] override_iface = true ``` When in `override_iface` mode, nmstate will: * For `interfaces` section, any defined interface will be configured by desire state information only. * Other sections will ignore this `override_iface` mode and still merging as it was. Technical detail: * When `override_iface: true`, we purge current network to only keep interface name and type before merging it with desire state. * When `override_iface: true`, we do not re-use existing NetworkManager connection. Integration test cases included. Resolves: https://issues.redhat.com/browse/RHEL-59935 Signed-off-by: Gris Ge <[email protected]>
- Loading branch information
Showing
15 changed files
with
224 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.