added hash check for node edit
Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
@@ -2,6 +2,7 @@ package node
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/wwlog"
|
||||
"gopkg.in/yaml.v2"
|
||||
@@ -24,3 +25,11 @@ func (config *NodeYaml) Hash() [32]byte {
|
||||
}
|
||||
return sha256.Sum256(data)
|
||||
}
|
||||
|
||||
/*
|
||||
Return the hash as string
|
||||
*/
|
||||
func (config *NodeYaml) StringHash() string {
|
||||
buffer := config.Hash()
|
||||
return hex.EncodeToString(buffer[:])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user