changing a profile always adds an empty default interface
Signed-off-by: jason yang <jasonyangshadow@gmail.com>
This commit is contained in:
@@ -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
|
- Boolean attributes now correctly account for profile and default
|
||||||
values. #630
|
values. #630
|
||||||
- Kernvel version is shown correctly
|
- Kernvel version is shown correctly
|
||||||
|
- Changing a profile always adds an empty default interface. #661
|
||||||
|
|
||||||
## [4.4.0rc3] 2022-12-23
|
## [4.4.0rc3] 2022-12-23
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import (
|
|||||||
|
|
||||||
// NodeSet is the wwapiv1 implmentation for updating nodeinfo fields.
|
// NodeSet is the wwapiv1 implmentation for updating nodeinfo fields.
|
||||||
func ProfileSet(set *wwapiv1.NodeSetParameter) (err error) {
|
func ProfileSet(set *wwapiv1.NodeSetParameter) (err error) {
|
||||||
|
|
||||||
if set == nil {
|
if set == nil {
|
||||||
return fmt.Errorf("NodeAddParameter is nil")
|
return fmt.Errorf("NodeAddParameter is nil")
|
||||||
}
|
}
|
||||||
@@ -85,6 +84,10 @@ func ProfileSetParameterCheck(set *wwapiv1.NodeSetParameter, console bool) (node
|
|||||||
for _, p := range profiles {
|
for _, p := range profiles {
|
||||||
if util.InSlice(set.NodeNames, p.Id.Get()) {
|
if util.InSlice(set.NodeNames, p.Id.Get()) {
|
||||||
wwlog.Verbose("Evaluating profile: %s", 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)
|
p.SetFrom(&pConf)
|
||||||
if set.NetdevDelete != "" {
|
if set.NetdevDelete != "" {
|
||||||
if _, ok := p.NetDevs[set.NetdevDelete]; !ok {
|
if _, ok := p.NetDevs[set.NetdevDelete]; !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user