diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb1c831..dc21fa93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -133,6 +133,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Allow iPXE to continue booting without runtime overlay. #806 - Format errors in logs as strings. #1563 - Fix display of profiles during node list. #1496 +- Fix internal DelProfile function to correctly operate on profiles rather than nodes. #1622 ## v4.5.8, 2024-10-01 diff --git a/internal/pkg/node/modifiers.go b/internal/pkg/node/modifiers.go index e20d3ccb..be9554aa 100644 --- a/internal/pkg/node/modifiers.go +++ b/internal/pkg/node/modifiers.go @@ -93,15 +93,15 @@ func (config *NodesYaml) AddProfile(profileId string) (*Profile, error) { } /* -delete node with the given id +delete profile with the given id */ -func (config *NodesYaml) DelProfile(nodeID string) error { - if _, ok := config.Nodes[nodeID]; !ok { - return errors.New("profile does not exist: " + nodeID) +func (config *NodesYaml) DelProfile(profileID string) error { + if _, ok := config.NodeProfiles[profileID]; !ok { + return errors.New("profile does not exist: " + profileID) } - wwlog.Verbose("deleting profile: %s", nodeID) - delete(config.Nodes, nodeID) + wwlog.Verbose("deleting profile: %s", profileID) + delete(config.NodeProfiles, profileID) return nil }