Merge pull request #733 from JasonYangShadow/issue/661

changing a profile always adds an empty default interface
This commit is contained in:
Christian Goll
2023-03-20 08:48:11 +01:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -33,6 +33,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
- Kernel version is shown correctly for symlink'd kernels #640
- Changing a profile always adds an empty default interface. #661
## [4.4.0rc3] 2022-12-23

View File

@@ -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 {