Default exception for networking

This change modifies the behavior of the clr-installer. By default, the
installer includes NetworkManager bundle in the list of bundles to be
installed. This commit introduces an exception: if systemd-networkd
is already present in the bundle list, the addition of NetworkManager
will be skipped.

Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
This commit is contained in:
Alex Jaramillo
2025-06-10 11:51:08 -07:00
committed by William Douglas
parent bad27e039c
commit 5f3f6b7ce4

View File

@@ -48,6 +48,7 @@ var (
const (
// NetWorkManager is the application to manage network.
NetWorkManager = "Network Manager"
NetworkdBundle = "systemd-networkd-autostart"
)
func sortMountPoint(bds []*storage.BlockDevice) []*storage.BlockDevice {
@@ -343,8 +344,9 @@ func Install(rootDir string, model *model.SystemInstall, options args.Args) erro
return err
}
// If we are using NetworkManager add the basic bundle
if network.IsNetworkManagerActive() {
// If we are using NetworkManager add the basic bundle, unless
// we have systemd-networkd bundle, in which case skip it
if network.IsNetworkManagerActive() && !model.ContainsBundle(NetworkdBundle) {
log.Info("Adding bundle '%s' to enable networking", network.RequiredBundle)
model.AddBundle(network.RequiredBundle)
}