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

[Helm3] Use default chart values for rendering the Changes tab when upgrading #1443

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,10 @@ describe("when receiving new props", () => {
});
});
});

it("shows, by default, the default values of the deployed chart plus any modification", () => {
const wrapper = shallow(<UpgradeForm {...defaultProps} appCurrentValues="foo: not-bar" />);
wrapper.setProps({ deployed: { values: "# A comment\nfoo: bar\n" } as IChartState["deployed"] });
const expectedValues = "# A comment\nfoo: not-bar\n";
expect(wrapper.find(DeploymentFormBody).prop("deployedValues")).toBe(expectedValues);
});
5 changes: 4 additions & 1 deletion dashboard/src/components/UpgradeForm/UpgradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ class UpgradeForm extends React.Component<IUpgradeFormProps, IUpgradeFormState>
<DeploymentFormBody
chartID={chartID}
chartVersion={this.props.appCurrentVersion}
deployedValues={this.props.appCurrentValues || ""}
deployedValues={this.applyModifications(
this.state.modifications || [],
this.props.deployed.values || "",
)}
namespace={this.props.namespace}
releaseVersion={this.props.appCurrentVersion}
selected={this.props.selected}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`renders the full UpgradeForm 1`] = `
appValues="foo: bar"
chartID="my-repo/my-chart"
chartVersion="1.0.0"
deployedValues="foo: bar"
deployedValues=""
getChartVersion={[Function]}
goBack={[Function]}
namespace="default"
Expand Down