Skip to content

Allow critical to be used without dhcp4/dhcp6 enabled#107

Merged
sil2100 merged 3 commits intocanonical:masterfrom
cedws:CriticalWithoutDHCP
Dec 17, 2019
Merged

Allow critical to be used without dhcp4/dhcp6 enabled#107
sil2100 merged 3 commits intocanonical:masterfrom
cedws:CriticalWithoutDHCP

Conversation

@cedws
Copy link
Contributor

@cedws cedws commented Oct 23, 2019

Description

This change allows the critical option to be used without dhcp4 or dhcp6 also being enabled. My understanding is that the underlying networkd option CriticalConnection also can prevent static IPs being dropped, not just ones assigned via DHCP. In my case, I needed to prevent IPs being assigned by keepalived from being dropped.

Checklist

  • [*] Runs make check successfully.
  • [*] Retains 100% code coverage (make check-coverage).
  • [*] New/changed keys in YAML format are documented.

@codecov-io
Copy link

codecov-io commented Oct 23, 2019

Codecov Report

Merging #107 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #107   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          36     36           
  Lines        4159   4160    +1     
=====================================
+ Hits         4159   4160    +1
Impacted Files Coverage Δ
tests/generator/test_common.py 100% <ø> (ø) ⬆️
src/networkd.c 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 053f2cb...d47443f. Read the comment docs.

Copy link
Contributor

@sil2100 sil2100 left a comment

Choose a reason for hiding this comment

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

This looks good in overall - the only request for change is adding a generator unit test for the new combination, i.e. something like test_dhcp_critical_true, just in case of critical: yes while there is no dhcp4 or dhcp6 defined.

I see that with systemd 243 the CriticalConnection option has been deprecated and instead a KeepConfiguration added - we might keep that in mind and switch to it in the future. For now CriticalConnection is wrapping around KeepConfiguration, so it's still good to land.

@sil2100
Copy link
Contributor

sil2100 commented Dec 13, 2019

Could you also merge latest trunk so that this is mergeable again?
Thanks!

@cedws cedws force-pushed the CriticalWithoutDHCP branch from 40204c1 to d47443f Compare December 13, 2019 23:54
@cedws
Copy link
Contributor Author

cedws commented Dec 13, 2019

Thanks for taking a look. I saw that there's already a test for this option, so I just modified it to not require dhcp4 or dhcp6 anymore. I couldn't actually figure out how to run the generator tests, but hopefully that should work. I've also rebased against master.

I might be able to help out with adding support for KeepConfiguration when the time comes.

Copy link
Contributor

@sil2100 sil2100 left a comment

Choose a reason for hiding this comment

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

I suppose we could have left the old test and added a new one to make sure it works for both cases, but actually this way is fine as well (since we know what we modified). Looks good from my POV - approving!

@sil2100 sil2100 merged commit 72a09f7 into canonical:master Dec 17, 2019
@cedws cedws deleted the CriticalWithoutDHCP branch December 17, 2019 20:54
@cedws
Copy link
Contributor Author

cedws commented Dec 17, 2019

Great, thanks again.

slyon pushed a commit that referenced this pull request Aug 20, 2024
…tions (#505)

* add prereq snippet

* add disable netfilter snippet

* add check networking delete default snippet

* add create bridge network snippet

* add system prereq snippet

* doc: move reuse/*.txt to .md files

This is for improved Markdown code highlighting.
Also, update the conf.py to ignore/exclude reuse/*.md files.
daniloegea pushed a commit that referenced this pull request Oct 9, 2024
…tions (#505)

* add prereq snippet

* add disable netfilter snippet

* add check networking delete default snippet

* add create bridge network snippet

* add system prereq snippet

* doc: move reuse/*.txt to .md files

This is for improved Markdown code highlighting.
Also, update the conf.py to ignore/exclude reuse/*.md files.
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