Skip to content
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

Print diffs when upgrade fails for validation reasons #1781

Closed
unguiculus opened this issue Jan 4, 2017 · 7 comments
Closed

Print diffs when upgrade fails for validation reasons #1781

unguiculus opened this issue Jan 4, 2017 · 7 comments
Assignees

Comments

@unguiculus
Copy link
Member

I'm trying out incubator/mongodb-replicaset. It works quite nicely so far. I installed it successfully. I then made changes to the ConfigMap containing the mongod.conf and tried to upgrade the chart. The result was this:

Error: UPGRADE FAILED: StatefulSet.apps "mongo-mongodb-replicaset" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas' are forbidden.

The only thing that I changed is the ConfigMap. The docs state that Helm only updates things that have changed since the last release. The ConfigMap was actually updated correctly even though the above error was the only output.

@technosophos
Copy link
Member

Looking at the chart, my guess is that the problem is that the deployment manifest is changed on upgrade:

https://github.com/kubernetes/charts/blob/master/incubator/mongodb-replicaset/templates/mongodb-petset.yaml#L58

So even though it's just a changed timestamp in an annotation, it's causing the deployment object to be sent through the update cycle.

(Actually, looks like there may be a few places where the statfulset is changed on upgrade -- mostly timestamp related.)

Is there a corresponding issue in the charts repo?

@unguiculus
Copy link
Member Author

Ah, thanks. I guess that's causing the issue. Adding the helm.sh/created annotation seems to be a quite common practice. I don't see why this would be useful.

The problem aside, I still think Helm's output could be improved. It just printed the error without telling me that the config map was indeed updated.

@technosophos
Copy link
Member

Improving output & logging of commands is something we're continually working on. I think we'll need some sort of way to turn on a more verbose mode for output messages.

Is it okay if I close this issue? Or would you like to change it up to add a specific feature request for an output message?

@iamzhout
Copy link
Contributor

Maybe one option is to to print out the diff between the new and old in case of any validation error? and also notifying user that although the error message, the configmap has been updated actually.

@technosophos technosophos changed the title Issues when updating a chart Print diffs when upgrade fails for validation reasons Jan 26, 2017
@technosophos
Copy link
Member

I'm currently thinking that the requirement for this one would be:

helm upgrade --debug would output a diff of old-to-new

Adding to the 2.3.0 milestone

@technosophos technosophos modified the milestones: 2.3.0, 2.4.0-Triage Feb 15, 2017
@nanliu
Copy link

nanliu commented Mar 2, 2017

So essentially: https://github.com/databus23/helm-diff/

@bacongobbler
Copy link
Member

yes, that plugin solves this use case exactly. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants