Skip to content
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

netdog: add primary-interface argument #3061

Merged
merged 1 commit into from
May 4, 2023

Conversation

yeazelm
Copy link
Contributor

@yeazelm yeazelm commented Apr 27, 2023

Issue number: #2449 has a sub task for D-Bus listener, this is part 2 of this change.

Closes #

Description of changes:
This command provides a way to get the machine's primary interface without reading the files directly which provides a CLI API to access this value. This will be used in yet to be implemented logic to watch this interface for changes on D-Bus.

Testing done:
cargo build, fmt, clippy, and test to ensure everything passes. This command isn't in play unless systemd-networkd is configured.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@yeazelm yeazelm requested a review from zmrow April 27, 2023 21:44
@yeazelm yeazelm marked this pull request as ready for review April 27, 2023 21:44
This argument provides the configured primary interface. This command
provides a way to get the machine's primary interface without reading
the files directly which provides a CLI API to access this value. This
will be used in yet to be implemented logic to watch this interface for
changes on D-Bus.
/// Return the current IP address
pub(crate) struct PrimaryInterfaceArgs {}

/// Return the current IP address as JSON (intended for use as a settings generator)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this comment seems like a copy/paste artifact, since I don't really see how we could use a settings generator for primary interface.

Suggested change
/// Return the current IP address as JSON (intended for use as a settings generator)

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

Looks good!

@yeazelm yeazelm merged commit 3265f10 into bottlerocket-os:develop May 4, 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