helm: requirements.lock does not get updated on helm dep up
if there is no change in requirements.yaml file but SemVar results into different lock file, helm dep up does not replace and existing requirements.lock because requirements.yaml digest has not changed.
How to reproduce:
We have the following requirements.yaml file for a chart parent1.
dependencies:
- name: child1
version: ">=1.0.0"
repository: "http://127.0.0.1:8879/"
- name: child2
version: ">=1.0.0"
repository: "http://127.0.0.1:8879/"
When we run dep up for the first time it generates following lock file (assuming that we have child1-1.0.0 and child2-1.0.0 charts at that point)
dependencies:
- name: child1
repository: http://127.0.0.1:8879/
version: 1.0.0
- name: child2
repository: http://127.0.0.1:8879/
version: 1.0.0
digest: sha256:19b7f91a0fdfc44e14a86e7b3bbfbce2014e063bdc5949c2ad6a5edb113c3b77
generated: 2017-07-27T12:00:08.036838191+05:30
Now if we release a new version of child1 (say 1.1.0) we don’t need to update our requirements.yaml file but we expect helm dep up to update requirements.lock file accordingly.
Instead, helm dep up updates /charts folder with child1-1.1.0 but does not update requirements.lock file on disk.
When we looked into code, we figured that requirements.lock only get updated if requirements.yaml gets changed.
// Hash requirements.yaml
hash, err := resolver.HashReq(req)
if err != nil {
return err
}
// Now we need to find out which version of a chart best satisfies the
// requirements the requirements.yaml
lock, err := m.resolve(req, repoNames, hash)
if err != nil {
return err
}
// If the lock file hasn't changed, don't write a new one.
oldLock, err := chartutil.LoadRequirementsLock(c)
if err == nil && oldLock.Digest == lock.Digest {
return nil
}
This results into inconsistent state of having different charts in /charts directory and requirements.lock file. Only work around, currently, is to delete requirements.lock file when we do helm dep up
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Fix helm2 lock file does not get updated Ref: https://github.com/helm/helm/issues/2731 — committed to nauxliu/helmfile by nauxliu 5 years ago
- Fix helm2 lock file does not get updated Ref: https://github.com/helm/helm/issues/2731 — committed to nauxliu/helmfile by nauxliu 5 years ago
- Fix helm2 lock file does not get updated Ref: https://github.com/helm/helm/issues/2731 — committed to nauxliu/helmfile by nauxliu 5 years ago
- Fix helm2 lock file does not get updated (#847) Ref: https://github.com/helm/helm/issues/2731 — committed to roboll/helmfile by nauxliu 5 years ago
Fixed in Helm 3 via #5874. Closing!
Same with Helm v2.11.0
I’m running into this problem as well. using helm 2.8.2 and S3 as a repo via https://github.com/hypnoglow/helm-s3
when I run
helm dep up, new sub-chart tarballs appear butrequirements.lockis not updated.@bacongobbler Can you please re-open? We just ran into this issue as well and as others report as well, this seems to still be a problem for more people.
Same with Helm v2.11.0, with s3 repo
I’m experiencing the same issue (new charts get downloaded but
requirements.lockstays the same) on Windows with Helm v2.10.0