Jmt/netdog/conditional removal
Issue number: 3618
Closes #3618
Removes conditional compilation of netdog for wicked and systemd networkd. This change moves our build system to build two variants of the netdog rpm: one for wicked and one for systemd-networkd. To facilitate this change the following was done:
- Migrate
#[cfg(net_backend = ]to#[cfg(feature = - Add two cargo features to sources/api/netdgo: 'wicked' and 'systemd-networkd'
- Extract netdog to its own package folder (packages/netdog)
- Extract netdog rpm building to netdog.spec
- Create two subpackages one netdog-wicked which provides netdog:1 and netdog-systemd-networkd which provides netdog:2
- Adjust all variants that require to still use wicked to define in their required packages "netdog-wicked" as a dependency, the default now is to use systemd-networkd
Testing done: Built and published aws-ecs-1 (wicked) and aws-ecs-2 (systemd-networkd) and verified network accessibility and use in a ecs cluster.
TODO: Setup local kubernetes/eks to run full test suite
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.
Rolled back to handling the binary split in the rpm spec. It is more than sufficient and attempts to split the binary at cargo level fell upon issues with how netdog is structured that were not minimal to address
Reason for return of using rpmspec:
The reason for this was a bunch of roadblock updates i ran into with splitting the binaries out:
- I first attempted a pretty straight forward split where i copied main.rs to two bin/networkd.rs and bin/wicked.rs files, this worked fine however leads to very large duplicate files since netdog currently re-uses its main.rs to set a large amount of static consts used throughout the crate
- I then tried a hack by just symlinking main.rs twice to avoid cargo complaining about two targets using the same main.rs This did not propagate well into git and our ci cd
- I then tried to do a lib and bin split where i took all the static const and most of the shared code to be in lib.rs and only moved the async main to the separated files, however this led to a collision with how netdog's multiple modules use private error messages with no shared top-type (meaning build error on visibility) this is fixable but would require alot ot making things public that i wasn't sure we wanted as such
As you can see above each approach i took to do the binary split at cargo time was bringing with it a bunch of more work when we had a functional solution. I decided to go back to a functional solution and file a github issue (which i need to do) for us to refactor netdog in the future to handle both this and how the cfgs are too integrated into too many source files
fix version number and remove accidental file
Addressing comments and rebase on latest
Addressed Ben's concerns on rpm adjustments Rebased off develop Restructured commits to isolate the move from edit and grouped changes by category of work
Removed redundant package in vmware variants
Testing result on changes: Everything looks good and is functioning as expected
rebased off latest
- Changed to utilize image-features
- Integrate use of dogtag hostname helpers
For testing I did the following:
- [x] aws-ecs-2 test
- [x] verify network connectivity
- [x] verify netdog-systemd-networkd is installed and symlinked
- [x] verify 10-reverse-dns is installed
- [x] verify 20-imds is installed
- [x] verify hostname got set correctly and it did not fall through to setting ip
- [x] aws-ecs-1 test
- [x] verify network connectivity
- [x] verify netdog-wicked is installed and symlinked
- [x] verify 10-reverse-dns is installed
- [x] verify 20-imds is installed
- [x] verify hostname got set correctly and it did not fallthrough to setting ip
Updated dogtag to handle fallback to ip address
Fix formatting
- Rebased off develop
- Bump netdog version
- Adjust Requires
- Add missing newline
- Remove extra newline
- Adjust comment