-
Notifications
You must be signed in to change notification settings - Fork 710
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
Add support for viewing and migrate Tiller releases #330
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9e1fcc4
Make the release name configurable
a5bfdaa
Use correct release name when upgrading
4d5784a
Add Tiller releases to Applications view. Add migration form to gener…
d57cef0
Rename helmCRDReleaseName and tillerReleaseName
7a2947f
Catch error when chart doesn't exist
1c70efb
Avoid using helm and tiller release names
128e8b6
Minor review
e569831
Bump helm-crd version
f86ab83
Apply review
2a5b566
Simplify code
85976eb
Verify app namespace
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import * as React from "react"; | ||
|
||
import { RouterAction } from "react-router-redux"; | ||
import { IApp, IChartState, IChartVersion } from "../../shared/types"; | ||
import { IAppRepository } from "../../shared/types"; | ||
|
||
import MigrateForm from "../../components/MigrateForm"; | ||
|
||
interface IAppMigrateProps { | ||
app: IApp; | ||
error: Error | undefined; | ||
namespace: string; | ||
releaseName: string; | ||
repos: IAppRepository[]; | ||
selected: IChartState["selected"]; | ||
migrateApp: ( | ||
version: IChartVersion, | ||
releaseName: string, | ||
namespace: string, | ||
values?: string, | ||
) => Promise<boolean>; | ||
getApp: (releaseName: string, namespace: string) => Promise<void>; | ||
push: (location: string) => RouterAction; | ||
fetchRepositories: () => Promise<void>; | ||
} | ||
|
||
class AppMigrate extends React.Component<IAppMigrateProps> { | ||
public componentDidMount() { | ||
const { fetchRepositories, releaseName, getApp, namespace } = this.props; | ||
getApp(releaseName, namespace); | ||
fetchRepositories(); | ||
} | ||
|
||
public componentWillReceiveProps(nextProps: IAppMigrateProps) { | ||
const { releaseName, getApp, namespace } = this.props; | ||
if (nextProps.namespace !== namespace) { | ||
getApp(releaseName, nextProps.namespace); | ||
} | ||
} | ||
|
||
public render() { | ||
const { app, repos } = this.props; | ||
if ( | ||
!repos || | ||
!app || | ||
!app.data || | ||
!app.data.chart || | ||
!app.data.chart.metadata || | ||
!app.data.chart.metadata.version || | ||
!app.data.chart.values | ||
) { | ||
return <div>Loading</div>; | ||
} | ||
return ( | ||
<div> | ||
<MigrateForm | ||
{...this.props} | ||
chartID={app.data.name} | ||
chartVersion={app.data.chart.metadata.version} | ||
chartValues={app.data.chart.values.raw} | ||
chartName={app.data.chart.metadata.name || ""} | ||
chartRepoName="" | ||
chartRepoURL="" | ||
chartRepoAuth="" | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default AppMigrate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import AppMigrate from "./AppMigrate"; | ||
|
||
export default AppMigrate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import * as Modal from "react-modal"; | |
|
||
interface IConfirmDialogProps { | ||
modalIsOpen: boolean; | ||
loading: boolean; | ||
onConfirm: () => Promise<any>; | ||
closeModal: () => Promise<any>; | ||
} | ||
|
@@ -39,19 +40,23 @@ class ConfirmDialog extends React.Component<IConfirmDialogProps, IConfirmDialogS | |
{this.state.error && ( | ||
<div className="padding-big margin-b-big bg-action">{this.state.error}</div> | ||
)} | ||
<div>Are you sure you want to delete this?</div> | ||
<div> | ||
<button className="button" onClick={this.props.closeModal}> | ||
Cancel | ||
</button> | ||
<button | ||
className="button button-primary button-danger" | ||
type="submit" | ||
onClick={this.props.onConfirm} | ||
> | ||
Delete | ||
</button> | ||
</div> | ||
{this.props.loading === true ? ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is needed to wait until the Tiller release is deleted, if not, after clicking "Delete" it goes directly to the Applications view and the deleted application is still there. |
||
<div> Loading ... </div> | ||
) : ( | ||
<div> | ||
<div> Are you sure you want to delete this? </div> | ||
<button className="button" onClick={this.props.closeModal}> | ||
Cancel | ||
</button> | ||
<button | ||
className="button button-primary button-danger" | ||
type="submit" | ||
onClick={this.props.onConfirm} | ||
> | ||
Delete | ||
</button> | ||
</div> | ||
)} | ||
</Modal> | ||
</div> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we call this button
Import App
?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 set this back to
Migrate
since there is now a banner that explains it in detail