Skip to content

Commit

Permalink
Revert to select the chart version of the current release on upgrade (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
absoludity authored Jan 7, 2020
1 parent 6da23eb commit a35fe63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions dashboard/src/components/UpgradeForm/UpgradeForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ it("renders the full UpgradeForm", () => {
expect(wrapper).toMatchSnapshot();
});

it("defaults the upgrade version to the current version", () => {
// helm upgrade is the only way to update the values.yaml, so upgrade is
// often used by users to update values only, so we can't default to the
// latest version on the assumption that they always want to upgrade.
const wrapper = shallow(
<UpgradeForm {...defaultProps} selected={{ versions, version: versions[0] }} />,
);

expect(wrapper.find(DeploymentFormBody).prop("chartVersion")).toBe("1.0.0");
});

it("forwards the appValues when modified", () => {
const wrapper = shallow(<UpgradeForm {...defaultProps} />);
const handleValuesChange: (v: string) => void = wrapper
Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/components/UpgradeForm/UpgradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class UpgradeForm extends React.Component<IUpgradeFormProps, IUpgradeFormState>
<div className="col-8">
<DeploymentFormBody
chartID={chartID}
chartVersion={this.props.selected.versions[0].attributes.version}
chartVersion={this.props.appCurrentVersion}
deployedValues={this.props.appCurrentValues || ""}
namespace={this.props.namespace}
releaseVersion={this.props.appCurrentVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`renders the full UpgradeForm 1`] = `
<DeploymentFormBody
appValues="foo: bar"
chartID="my-repo/my-chart"
chartVersion="1.2.3"
chartVersion="1.0.0"
deployedValues="foo: bar"
getChartVersion={[Function]}
goBack={[Function]}
Expand Down

0 comments on commit a35fe63

Please sign in to comment.