@ -157,6 +157,22 @@ func HashReq(req, lock []*chart.Dependency) (string, error) {
return "sha256:" + s , err
return "sha256:" + s , err
}
}
// HashV2Req generates a hash of requirements generated in Helm v2.
//
// This should be used only to compare against another hash generated by the
// Helm v2 hash function. It is to handle issue:
// https://github.com/helm/helm/issues/7233
func HashV2Req ( req [ ] * chart . Dependency ) ( string , error ) {
dep := make ( map [ string ] [ ] * chart . Dependency )
dep [ "dependencies" ] = req
data , err := json . Marshal ( dep )
if err != nil {
return "" , err
}
s , err := provenance . Digest ( bytes . NewBuffer ( data ) )
return "sha256:" + s , err
}
// GetLocalPath generates absolute local path when use
// GetLocalPath generates absolute local path when use
// "file://" in repository of dependencies
// "file://" in repository of dependencies
func GetLocalPath ( repo , chartpath string ) ( string , error ) {
func GetLocalPath ( repo , chartpath string ) ( string , error ) {