Ephemeral Networking for FreeBSD#2165
Conversation
| self.name = name | ||
| self.networking: Networking = self.networking_cls() | ||
| self.dhcp_client_priority = [dhcp.IscDhclient, dhcp.Dhcpcd] | ||
| self.net_ops = iproute2.Iproute2 |
There was a problem hiding this comment.
is this intended to be configurable? defined as class variable and instance variable
There was a problem hiding this comment.
is this intended to be configurable? defined as class variable and instance variable
This is not intended to be configurable at runtime. This is defined as an instance variable to avoid unpickle issues across the upgrade path. It might not be required as a class variable, I don't recall why it is defined both ways.
| "-sf", | ||
| "/bin/true", | ||
| ] + (["-cf", config_file, interface] if config_file else [interface]) | ||
|
|
There was a problem hiding this comment.
just a personal preference, but for readability, I think I'd rather see the args built up over a few lines and conditionals than trying to get it all into one statement. e.g.
args = [
path,
"-1",
"-v",
"-lf",
lease_file,
"-pf",
pid_file,
"-sf",
"/bin/true",
]
if config_file:
args.extend(["-cf", config_file, interface])
args.append(interface)
I may be alone in this preference, so feel free to ignore :D
There was a problem hiding this comment.
i like the idea!
but this, too is @holmanb's code.
| if gateway and gateway != "0.0.0.0": | ||
| subp.subp( | ||
| ["route", "change", route, gateway], | ||
| ) |
There was a problem hiding this comment.
We don't support source selection
and i had to make this addition in two steps, because when i did it in a single step, the result was nonsense.
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.) |
This comment was marked as resolved.
This comment was marked as resolved.
- add and append are the same - device routes need to be added in two steps
preemptively remove "inet" so we can add IPv6 in a distant future.
Proposed Commit Message
Additional Context
This is based on #2127
Test Steps
I have tested this successfully on libvirt with NoCloud (standard dhcp), on Hetzner (EphemeralDHCPv4) and with config-drive with a static network setup (regards to @goneri )
Checklist: