-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kubernetes): support rolling restart operation for deployments (#…
- Loading branch information
1 parent
7e8cb7e
commit 17be6af
Showing
4 changed files
with
72 additions
and
0 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
55 changes: 55 additions & 0 deletions
55
app/scripts/modules/kubernetes/src/v2/manifest/rollout/RollingRestart.tsx
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,55 @@ | ||
import { module } from 'angular'; | ||
|
||
import * as React from 'react'; | ||
import { react2angular } from 'react2angular'; | ||
|
||
import { Application, ManifestWriter, ReactInjector } from '@spinnaker/core'; | ||
|
||
import { IKubernetesServerGroupManager } from 'kubernetes/v2/serverGroupManager'; | ||
|
||
interface IRollingRestartProps { | ||
application: Application; | ||
serverGroupManager: IKubernetesServerGroupManager; | ||
} | ||
|
||
interface IRollingRestartParameters { | ||
account: string; | ||
cloudProvider: string; | ||
location: string; | ||
manifestName: string; | ||
} | ||
|
||
function RollingRestart({ application, serverGroupManager }: IRollingRestartProps) { | ||
function rollingRestart() { | ||
const rollingRestartParameters: IRollingRestartParameters = { | ||
account: serverGroupManager.account, | ||
cloudProvider: 'kubernetes', | ||
location: serverGroupManager.namespace, | ||
manifestName: serverGroupManager.name, | ||
}; | ||
ReactInjector.confirmationModalService.confirm({ | ||
account: serverGroupManager.account, | ||
askForReason: true, | ||
header: `Initiate rolling restart of ${serverGroupManager.name}`, | ||
provider: 'kubernetes', | ||
submitMethod: () => { | ||
return ManifestWriter.rollingRestartManifest(rollingRestartParameters, application); | ||
}, | ||
taskMonitorConfig: { | ||
application, | ||
title: `Rolling restart of ${serverGroupManager.name}`, | ||
}, | ||
}); | ||
} | ||
return ( | ||
<li> | ||
<a onClick={rollingRestart}>Rolling Restart</a> | ||
</li> | ||
); | ||
} | ||
|
||
export const KUBERNETES_ROLLING_RESTART = 'spinnaker.kubernetes.v2.rolling.restart'; | ||
module(KUBERNETES_ROLLING_RESTART, []).component( | ||
'kubernetesRollingRestart', | ||
react2angular(RollingRestart, ['application', 'serverGroupManager']), | ||
); |
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