mirror of
https://github.com/mudler/luet.git
synced 2025-09-01 23:37:07 +00:00
Use packageImage as builder image fingerprint
This allows to have an unique identifier for the builder image id against different depgraphs combinations. The package fingerprint is not enough, as an atom could have a difference deptree depending on the requires constraints. TODO: Don't use the full image name, but only the hash as a salt (currently the salt contains ALSO a reference of the image-repository, as such it doesn't allow to port a tree in a different docker registry)
This commit is contained in:
@@ -105,7 +105,7 @@ type Package interface {
|
||||
|
||||
String() string
|
||||
HumanReadableString() string
|
||||
HashFingerprint() string
|
||||
HashFingerprint(string) string
|
||||
|
||||
Clone() Package
|
||||
}
|
||||
@@ -205,9 +205,9 @@ func (p *DefaultPackage) GetFingerPrint() string {
|
||||
return fmt.Sprintf("%s-%s-%s", p.Name, p.Category, p.Version)
|
||||
}
|
||||
|
||||
func (p *DefaultPackage) HashFingerprint() string {
|
||||
func (p *DefaultPackage) HashFingerprint(salt string) string {
|
||||
h := md5.New()
|
||||
io.WriteString(h, p.GetFingerPrint())
|
||||
io.WriteString(h, fmt.Sprintf("%s-%s",p.GetFingerPrint(),salt))
|
||||
return fmt.Sprintf("%x", h.Sum(nil))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user