1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-03-05 15:15:44 +02:00
Googlom ab62827a3e
Update buildpacks/lifecycle dependency (#4801)
* update lib version and fix code

* remove outdated replace statement

* update helm.sh/helm/v3

---------

Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2024-01-29 10:45:25 +05:00

31 lines
519 B
Go

package cnbutils
import (
"fmt"
"github.com/BurntSushi/toml"
"github.com/buildpacks/lifecycle/platform/files"
)
const reportFile = "/layers/report.toml"
func DigestFromReport(utils BuildUtils) (string, error) {
report := files.Report{}
data, err := utils.FileRead(reportFile)
if err != nil {
return "", err
}
err = toml.Unmarshal(data, &report)
if err != nil {
return "", err
}
if report.Image.Digest == "" {
return "", fmt.Errorf("image digest is empty")
}
return report.Image.Digest, nil
}