-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli service: Allow user to opt-in on not deleting applied file #2546
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
I don't know enough rust to evaluate the code in this diff, but I do want to clarify, historic behavior was to I'm being very specific here because configuring network interfaces is a very foundational bit of configuration and changing this behavior may leave some hosts with broken network configs which can be a SEV 1 type outage. Consider a case where an operator has configuration management dropping 2 files in /etc/nmstate, 000-reset.yml and 100-configure-defaults.yml where the first file deletes various interface and route configurations to establish a known initial state and then in the second file applies the intended end state. It would break networking if the contents of 000-reset.yml were changed and were resultantly re-applied while the contents of 100-configure-defaults.yml were unchanged and then not re-applied. You will have effectively stopped The above example is only an example, but it is meant to illustrate the importance of EXACTLY preserving the default behavior of this tool until/unless a behavioral change is released as part of a major version change and/or is well documented and disclosed in a series of "coming breaking change/deprecation" notices. |
d93d386
to
ec7e2bd
Compare
@drawks Thanks for the detailed use case. I have included test case By default, Any user want to keep applied by as it was, they can opt-in by create [service]
delete_applied = false In general, this PR is restoring the old behavior and we have test to ensure that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit on the config field name.
Previously, we introduced new method on finding un-applied state YAML files. It was a changed behaviour which break API. This patch change `nmstatectl service` to original behaviour which just rename applied YAML file with `.applied` postfix. If you don't want the applied state been deleted, please place `/etc/nmstate/nmstate.conf` (folder can be defined by `--config` argument) with content of: ```toml [service] keep_state_file_after_apply = true ``` Manpage updated. Integration test case included. Signed-off-by: Gris Ge <fge@redhat.com>
When [1] land to RHCOS the nmstate service will go back to previous behaviour, the /etc/nmstate/*.yml files are moved to .applied files, so we need to configure nmstate to keep the those files, if we don't do so MCO complains at in place upgrades since the file system has change. [1] nmstate/nmstate#2546 Signed-off-by: Enrique Llorente <ellorent@redhat.com>
When [1] land to RHCOS the nmstate service will go back to previous behaviour, the /etc/nmstate/*.yml files are moved to .applied files, so we need to configure nmstate to keep the those files, if we don't do so MCO complains at in place upgrades since the file system has change. [1] nmstate/nmstate#2546 Signed-off-by: Enrique Llorente <ellorent@redhat.com>
When [1] land to RHCOS the nmstate service will go back to previous behaviour, the /etc/nmstate/*.yml files are moved to .applied files, so we need to configure nmstate to keep the those files, if we don't do so MCO complains at in place upgrades since the file system has change. [1] nmstate/nmstate#2546 Signed-off-by: Enrique Llorente <ellorent@redhat.com>
When [1] land to RHCOS the nmstate service will go back to previous behaviour, the /etc/nmstate/*.yml files are moved to .applied files, so we need to configure nmstate to keep the those files, if we don't do so MCO complains at in place upgrades since the file system has change. [1] nmstate/nmstate#2546 Signed-off-by: Enrique Llorente <ellorent@redhat.com>
Previously, we introduced new method on finding un-applied state YAML
files. It was a changed behaviour which break API.
This patch change
nmstatectl service
to original behaviour which justrename applied YAML file with
.applied
postfix.If you don't want the applied state been deleted, please place
/etc/nmstate/nmstate.conf
(folder can be defined by--config
argument) with content of:
Manpage updated.
Integration test case included.