-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prerelease versions cannot be used from lock file by default #1269
Comments
@ostlerc Hey. Unfortunately I think I don't understand the issue fully. Would you mind clarifying a bit more? First, why you need |
very sorry for the confusion. the |
I see the root issue. If we do not specify a version in the helmfile yaml for a release we seem to use the constraint '*' by default. this is the code i'm talking about in func (d *ResolvedDependencies) Get(chart, versionConstraint string) (string, error) {
if versionConstraint == "" {
versionConstraint = "*"
}
deps, exists := d.deps[chart]
if exists {
for _, dep := range deps {
constraint, err := semver.NewConstraint(versionConstraint)
if err != nil {
return "", err
}
version, err := semver.NewVersion(dep.Version)
if err != nil {
return "", err
}
if constraint.Check(version) {
return dep.Version, nil
}
}
}
return "", fmt.Errorf("no resolved dependency found for \"%s\"", chart)
} We are trying to use the lock file as the version to be used. It's extremely confusing when doing a diff with a lock file for helmfile to try to find versions at all for me, it especially doesn't make sense to me that we try to apply constraints that restrict pre-release without explicitly stating in the yaml that is what we want. |
@ostlerc Would u mind clarifying a bit more - How did you set |
I thought that the point of using |
In other words, I was wondering if this was your intention:
|
very interesting. yes we are in the habit of manually editing the lockfile for specific versions. that constraint you gave me is very useful, I think I will use that. another side conversation would be if we are not meant to use the lock file to specify the versions we want, are you expecting everyone to use constraints and update their dependencies every helmfile command? I noticed it seems to really want to do that without the flags. I can see that it is useful for keeping things up to date, but we are trying to use helmfile as a way to guarantee an exact state of our cluster. essentially just a list of charts with versions we want and some values files magic sprinkled around. |
If one wants to do that, yes. But anyway, it's intended to be used in CI to let helmfile fetch the latest version numbers that satisfy the constraint and update the lock file automatically. Lock files are for helmfile to edit, not human. People would review helmfile.lock updated by helmfile though, rather than people manually editing it. That being said, in your case, I was expecting that you would just write the below as you do seem to know the exact version number you want:
I think it doesn't matter if Can I ask why you've been updating the lock file manually? |
we have a template of all our applications and would require passing that in for each one. currently it's just a list of chart names. the lock file was the easiest place to see all versions in one location and editing the lock file gave the results that we want (setting versions). We could use constraints, but I think the general consensus is we are making ourselves choose versions to deploy for production and don't need to worry about them changing without human intervention. I'm happy to talk more about it if you'd like. Just let me know if you have any further questions on the subject. Perhaps a takeaway from this is that it was not obvious to me how this should be used. also the ability to use the constraints in the yaml is a nice feature perhaps if we had understood from the beginning our workflow would be different right now. |
I am trying to set a pre-release version in my lock file. it looks something like this.
my yaml looks something like this
running
helmfile diff
I immediately getin ./helmfile.yaml: no resolved dependency found for "auth"
Note that this command works
helm upgrade auth myrepo/auth --version '0.5.2-release20200527.2+49d32d0'
if I change my yaml to look like
then the helmfile command works. I would expect to be able to specify my unstable chart version in the lock file and for it to be found. it only seems to be found while explicitly set in my helmfile.yaml.
EDIT: to any seeing this, you must set the version constraint in the helmfile.yaml for your release to be able to install prerelease versions, just editing manually lock files won't do it.
The text was updated successfully, but these errors were encountered: