diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c89fd35..a8dbdb79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Boolean attributes now correctly account for profile and default values. #630 - Kernvel version is shown correctly +- Changing a profile always adds an empty default interface. #661 ## [4.4.0rc3] 2022-12-23 diff --git a/internal/pkg/api/profile/profile.go b/internal/pkg/api/profile/profile.go index 57aa40b7..15fc4512 100644 --- a/internal/pkg/api/profile/profile.go +++ b/internal/pkg/api/profile/profile.go @@ -15,7 +15,6 @@ import ( // NodeSet is the wwapiv1 implmentation for updating nodeinfo fields. func ProfileSet(set *wwapiv1.NodeSetParameter) (err error) { - if set == nil { return fmt.Errorf("NodeAddParameter is nil") } @@ -85,6 +84,10 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node for _, p := range profiles { if util.InSlice(set.NodeNames, p.Id.Get()) { wwlog.Verbose("Evaluating profile: %s", p.Id.Get()) + // Fix issue: https://github.com/hpcng/warewulf/issues/661 + if p.Id.Get() == "default" && len(p.NetDevs) == 0 { + set.NetdevDelete = p.Id.Get() + } p.SetFrom(&pConf) if set.NetdevDelete != "" { if _, ok := p.NetDevs[set.NetdevDelete]; !ok {