@ -163,7 +163,7 @@ func (m *Manager) Update() error {
}
}
// Finally, we need to write the lockfile.
// Finally, we need to write the lockfile.
return writeLock ( m . ChartPath , lock )
return writeLock ( m . ChartPath , lock , c . Metadata . APIVersion == chart . APIVersionV1 )
}
}
func ( m * Manager ) loadChartDir ( ) ( * chart . Chart , error ) {
func ( m * Manager ) loadChartDir ( ) ( * chart . Chart , error ) {
@ -634,12 +634,16 @@ func (m *Manager) loadChartRepositories() (map[string]*repo.ChartRepository, err
}
}
// writeLock writes a lockfile to disk
// writeLock writes a lockfile to disk
func writeLock ( chartpath string , lock * chart . Lock ) error {
func writeLock ( chartpath string , lock * chart . Lock , legacyLockfile bool ) error {
data , err := yaml . Marshal ( lock )
data , err := yaml . Marshal ( lock )
if err != nil {
if err != nil {
return err
return err
}
}
dest := filepath . Join ( chartpath , "Chart.lock" )
lockfileName := "Chart.lock"
if legacyLockfile {
lockfileName = "requirements.lock"
}
dest := filepath . Join ( chartpath , lockfileName )
return ioutil . WriteFile ( dest , data , 0644 )
return ioutil . WriteFile ( dest , data , 0644 )
}
}