Closed agners closed 3 weeks ago
An alternative to this would be to allow null
for gateway
(and potentially also nameservers
as an alternative to an empty list) to clear these settings. This essentially would keep the patch style API.
However, the support for nameservers
in auto
mode would be problematic with the current frontend: The frontend code only sets the method
property. Hence when switching from static
the nameservers
would get inherited. This might not what the user intended.
Also the CLI would need a way to set no nameserver (currently that is not possible since the --ipvX-nameserver
argument is additive only). The CLI I don't see that critical, we can implement the replace type behavior for the CLI client side (which probably would make sense).
Another option here would be to make the complete API replace style. For the frontend this would work without a problem as all aspects (ipv4
, ipv6
, wifi
and enabled
are set always.
[!WARNING]
Rate limit exceeded
@agners has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 43 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between 885506fd37395eb6cea9c787ee23349dac780b75 and 71a47b13cb11cab323b7f8f7bba6124fa3359db0.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Proposed change
This changes the network API behavior to replace IP configuration and WiFi settings instead of updating them.
It also adds support to set DNS (via
nameservers
property) when methodauto
is used. This allows to set a DNS server in case DHCP does not provide one, or overrides theUpdate by replacing the whole IP configuration has advantages:
This also works out quite well with how the frontend behaves, it essentially keeps the behavior as it is today:
method
property. So this clears lingeringnameservers
.method
,addresses
,gateway
andnameservers
), so no change in behavior.However, this does change the CLI behavior: Missing options now really lead to clearing that particular field. However, this seems the more expected behavior, e.g. the following sequence:
With the patch style API, this would not have cleared the DNS. Clearing was only possible by switching to method
auto
and then back tostatic
.Type of change
Additional information
Checklist
ruff format supervisor tests
)If API endpoints or add-on configuration are added/changed:
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Documentation