-
Notifications
You must be signed in to change notification settings - Fork 326
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
Show diff when upgrading #934
Conversation
db5d387
to
ae623f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great Thomas, thanks for writing the diffing logic to be so clear and readable!
Is it worth noting somewhere (docs, comments, etc) that the install overrides and the the diff output will always only show the difference between user-set overrides in the installation and user-set overrides in the upgrade, rather than only the values that are different from the defaults? (For example in the screenshots below, I explicitly set global.enabled=true during install and didn't set it while upgrading, but the default value of global.enabled is true anyways, but it still shows up in the diff).
One slight nit (also shown in the screenshots below) is that the values output for install is indented one tab over from the values output for upgrade. Also, install calls those values "Overrides". I think it makes sense to also use the title "Overrides" for the upgrade diff as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work on this PR Thomas!! I really love the refactor and all the work on tests! I'm continuing to review today (and apologies for taking long) but wanted to leave comments I have so far.
I noticed a few things when running the command with -dry-run
(full output below):
- It displayed the summary twice, and only one of them had the diffing. I think we probably only need to display one with diffing.
- It said
Performing dry run upgrade
twice. Once in the beginning without the===>
and then once after the first summary. - It was kind of stuck for a bit at the
--> preparing upgrade for consul
line, which seemed strange because the info it displayed wasn't that different from the one displayed by==> Consul Upgrade Summary
. I'm not sure if this is something that is expected.
Here is the full output:
$ go run . upgrade -preset demo -set server.replicas=3 -dry-run
Performing dry run upgrade.
==> Pre-Upgrade Checks
✓ Existing installation found to be upgraded.
Name: consul
Namespace: consul
✓ Loaded charts
==> Consul Upgrade Summary
Installation name: consul
Namespace: consul
connectInject:
enabled: true
metrics:
defaultEnableMerging: true
defaultEnabled: true
enableGatewayMetrics: true
controller:
enabled: true
global:
metrics:
enableAgentMetrics: true
enabled: true
name: consul
prometheus:
enabled: true
server:
- replicas: 1
+ replicas: 3
ui:
enabled: true
service:
enabled: true
==> Performing Dry Run Upgrade
--> preparing upgrade for consul
--> performing update for consul
--> dry run for consul
Dry run complete - upgrade can proceed.
Config:
connectInject:
enabled: true
metrics:
defaultEnableMerging: true
defaultEnabled: true
enableGatewayMetrics: true
controller:
enabled: true
global:
metrics:
enableAgentMetrics: true
enabled: true
name: consul
prometheus:
enabled: true
server:
replicas: 3
ui:
enabled: true
service:
enabled: true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finishing my review. A few more comments.
This is such an interesting question. I think the solution for now is what you said where there is a note "Diffing user overrides..." something like that. I think we should discuss the right approach for future iterations as a team. Should we show the whole diff with the whole helm chart or just the overrides? I could go either way. |
de6c477
to
782a162
Compare
802dd04
to
c2f30aa
Compare
…ssues with the connect-injector webhook not starting on an install?
…ssues with the connect-injector webhook not starting on an install?
…ssues with the connect-injector webhook not starting on an install?
…previous Release and the new upgrade.
947e917
to
ed9cb46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good! Thanks for your patience as we were working through the UX and having long review cycles.
Leaving a few minor comments, but won't block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me Thomas, I didn't try manually testing this time around, but let me know if you'd like me to!
Changes proposed in this PR:
LoadChart
function for loading Helm charts.Screen.Recording.2022-01-06.at.2.36.00.PM.mov
How I've tested this PR:
How I expect reviewers to test this PR:
The best way to quickly see the change is to use the CLI to install the
demo
preset, then upgrade to thesecure
preset.From
./cli
,go run . install -preset demo
Wait for install to complete. Then
go run . upgrade -preset secure
You will see the difference between the two displayed as a diff:
Checklist: