-
Notifications
You must be signed in to change notification settings - Fork 707
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for viewing and migrate Tiller releases (#330)
* Make the release name configurable * Use correct release name when upgrading * Add Tiller releases to Applications view. Add migration form to generate Helm CRDs * Rename helmCRDReleaseName and tillerReleaseName * Catch error when chart doesn't exist * Avoid using helm and tiller release names * Minor review * Bump helm-crd version * Apply review * Simplify code * Verify app namespace
- Loading branch information
1 parent
232e8a0
commit b1c599a
Showing
22 changed files
with
588 additions
and
67 deletions.
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
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.