@ -19,6 +19,7 @@ import (
"fmt"
"fmt"
"io"
"io"
"io/ioutil"
"io/ioutil"
"log"
"net/url"
"net/url"
"os"
"os"
"path"
"path"
@ -87,12 +88,17 @@ func (m *Manager) Build() error {
if sum , err := resolver . HashReq ( req , lock . Dependencies ) ; err != nil || sum != lock . Digest {
if sum , err := resolver . HashReq ( req , lock . Dependencies ) ; err != nil || sum != lock . Digest {
// If lock digest differs and chart is apiVersion v1, it maybe because the lock was built
// If lock digest differs and chart is apiVersion v1, it maybe because the lock was built
// with Helm 2 and should therefore be regenerated
// with Helm 2 and therefore should be checked with Helm v2 hash
// Fix for: https://github.com/helm/helm/issues/7233
if c . Metadata . APIVersion == chart . APIVersionV1 {
if c . Metadata . APIVersion == chart . APIVersionV1 {
return m . Update ( )
log . Println ( "warning: a valid Helm v3 hash was not found. Checking against Helm v2 hash..." )
if sum , err := resolver . HashV2Req ( req ) ; err != nil || sum != lock . Digest {
return errors . New ( "Chart.lock is out of sync with Chart.yaml" )
}
}
} else {
return errors . New ( "Chart.lock is out of sync with Chart.yaml" )
return errors . New ( "Chart.lock is out of sync with Chart.yaml" )
}
}
}
// Check that all of the repos we're dependent on actually exist.
// Check that all of the repos we're dependent on actually exist.
if err := m . hasAllRepos ( lock . Dependencies ) ; err != nil {
if err := m . hasAllRepos ( lock . Dependencies ) ; err != nil {