@spinnaker/kubernetes 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pipelines/stages/deployManifest/ManifestDeploymentOptions.d.ts +0 -2
- package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatus.d.ts +1 -0
- package/dist/pipelines/stages/index.d.ts +1 -0
- package/dist/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.d.ts +13 -0
- package/dist/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.d.ts +4 -0
- package/package.json +8 -5
- package/src/pipelines/stages/deployManifest/DeployManifestStageForm.tsx +0 -1
- package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.spec.tsx +0 -15
- package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.tsx +1 -20
- package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.less +11 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.tsx +27 -15
- package/src/pipelines/stages/index.ts +1 -0
- package/src/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.tsx +46 -0
- package/src/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.ts +20 -0
- package/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx +1 -1
|
@@ -16,12 +16,10 @@ export interface IManifestDeploymentOptionsProps {
|
|
|
16
16
|
config: ITrafficManagementConfig;
|
|
17
17
|
onConfigChange: (config: ITrafficManagementConfig) => void;
|
|
18
18
|
selectedAccount: string;
|
|
19
|
-
isDeploymentKind: boolean;
|
|
20
19
|
}
|
|
21
20
|
export interface IManifestDeploymentOptionsState {
|
|
22
21
|
services: string[];
|
|
23
22
|
showRedBlackWarningMessage: boolean;
|
|
24
|
-
showBlueGreenDeploymentWarningMessage: boolean;
|
|
25
23
|
}
|
|
26
24
|
export declare class ManifestDeploymentOptions extends React.Component<IManifestDeploymentOptionsProps, IManifestDeploymentOptionsState> {
|
|
27
25
|
state: IManifestDeploymentOptionsState;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './deleteManifest/deleteManifestStage';
|
|
2
2
|
export * from './deployManifest/deployManifestStage';
|
|
3
3
|
export * from './patchManifest/patchManifestStage';
|
|
4
|
+
export * from './rolloutRestartManifest/rolloutRestartManifestStage';
|
|
4
5
|
export * from './runJob/runJobStage';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Application, IStage, IStageConfigProps } from '@spinnaker/core';
|
|
3
|
+
import type { IManifestSelector } from '../../../manifest/selector/IManifestSelector';
|
|
4
|
+
export interface IKubernetesManifestStageConfigProps extends IStageConfigProps {
|
|
5
|
+
application: Application;
|
|
6
|
+
stage: IManifestSelector & IStage;
|
|
7
|
+
stageFieldUpdated: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare class RolloutRestartManifestStageConfig extends React.Component<IKubernetesManifestStageConfigProps> {
|
|
10
|
+
componentDidMount: () => void;
|
|
11
|
+
private onChange;
|
|
12
|
+
render(): JSX.Element;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinnaker/kubernetes",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
7
10
|
"scripts": {
|
|
8
11
|
"clean": "shx rm -rf dist",
|
|
9
12
|
"prepublishOnly": "npm run build",
|
|
@@ -13,7 +16,7 @@
|
|
|
13
16
|
"lib": "npm run build"
|
|
14
17
|
},
|
|
15
18
|
"dependencies": {
|
|
16
|
-
"@spinnaker/core": "^0.
|
|
19
|
+
"@spinnaker/core": "^0.28.0",
|
|
17
20
|
"@uirouter/angularjs": "1.0.26",
|
|
18
21
|
"@uirouter/react": "1.0.7",
|
|
19
22
|
"angular": "1.6.10",
|
|
@@ -35,8 +38,8 @@
|
|
|
35
38
|
"rxjs": "6.6.7"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
|
-
"@spinnaker/eslint-plugin": "^3.0.
|
|
39
|
-
"@spinnaker/scripts": "^0.
|
|
41
|
+
"@spinnaker/eslint-plugin": "^3.0.2",
|
|
42
|
+
"@spinnaker/scripts": "^0.4.0",
|
|
40
43
|
"@types/angular": "1.6.26",
|
|
41
44
|
"@types/angular-ui-bootstrap": "0.13.41",
|
|
42
45
|
"@types/dompurify": "^2.3.3",
|
|
@@ -50,5 +53,5 @@
|
|
|
50
53
|
"shx": "0.3.3",
|
|
51
54
|
"typescript": "4.3.5"
|
|
52
55
|
},
|
|
53
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "20d6ca89f39a5f44a802a1ccaffd669587450d76"
|
|
54
57
|
}
|
|
@@ -192,7 +192,6 @@ export class DeployManifestStageForm extends React.Component<
|
|
|
192
192
|
config={stage.trafficManagement}
|
|
193
193
|
onConfigChange={(config) => this.props.formik.setFieldValue('trafficManagement', config)}
|
|
194
194
|
selectedAccount={stage.account}
|
|
195
|
-
isDeploymentKind={this.state.rawManifest.includes('kind: Deployment')}
|
|
196
195
|
/>
|
|
197
196
|
</div>
|
|
198
197
|
);
|
|
@@ -17,7 +17,6 @@ describe('<ManifestDeploymentOptions />', () => {
|
|
|
17
17
|
config: defaultTrafficManagementConfig,
|
|
18
18
|
onConfigChange: onConfigChangeSpy,
|
|
19
19
|
selectedAccount: null,
|
|
20
|
-
isDeploymentKind: null,
|
|
21
20
|
};
|
|
22
21
|
wrapper = shallow(<ManifestDeploymentOptions {...props} />);
|
|
23
22
|
});
|
|
@@ -72,19 +71,5 @@ describe('<ManifestDeploymentOptions />', () => {
|
|
|
72
71
|
wrapper = shallow(<ManifestDeploymentOptions {...props} />);
|
|
73
72
|
expect(wrapper.find('p[id="redBlackWarning"]').exists()).toEqual(true);
|
|
74
73
|
});
|
|
75
|
-
|
|
76
|
-
it('strategy bluegreen with deployment kind should display warning label', () => {
|
|
77
|
-
props.config.options.strategy = 'bluegreen';
|
|
78
|
-
props.isDeploymentKind = true;
|
|
79
|
-
wrapper = shallow(<ManifestDeploymentOptions {...props} />);
|
|
80
|
-
expect(wrapper.find('p[id="blueGreenWarning"]').exists()).toEqual(true);
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('strategy bluegreen with replicaSet kind should not display warning label', () => {
|
|
84
|
-
props.config.options.strategy = 'bluegreen';
|
|
85
|
-
props.isDeploymentKind = false;
|
|
86
|
-
wrapper = shallow(<ManifestDeploymentOptions {...props} />);
|
|
87
|
-
expect(wrapper.find('p[id="blueGreenWarning"]').exists()).toEqual(false);
|
|
88
|
-
});
|
|
89
74
|
});
|
|
90
75
|
});
|
|
@@ -37,24 +37,18 @@ export interface IManifestDeploymentOptionsProps {
|
|
|
37
37
|
config: ITrafficManagementConfig;
|
|
38
38
|
onConfigChange: (config: ITrafficManagementConfig) => void;
|
|
39
39
|
selectedAccount: string;
|
|
40
|
-
isDeploymentKind: boolean;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
export interface IManifestDeploymentOptionsState {
|
|
44
43
|
services: string[];
|
|
45
44
|
showRedBlackWarningMessage: boolean;
|
|
46
|
-
showBlueGreenDeploymentWarningMessage: boolean;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
export class ManifestDeploymentOptions extends React.Component<
|
|
50
48
|
IManifestDeploymentOptionsProps,
|
|
51
49
|
IManifestDeploymentOptionsState
|
|
52
50
|
> {
|
|
53
|
-
public state: IManifestDeploymentOptionsState = {
|
|
54
|
-
services: [],
|
|
55
|
-
showRedBlackWarningMessage: false,
|
|
56
|
-
showBlueGreenDeploymentWarningMessage: false,
|
|
57
|
-
};
|
|
51
|
+
public state: IManifestDeploymentOptionsState = { services: [], showRedBlackWarningMessage: false };
|
|
58
52
|
|
|
59
53
|
private onConfigChange = (key: string, value: any): void => {
|
|
60
54
|
this.setState({ showRedBlackWarningMessage: false });
|
|
@@ -62,9 +56,6 @@ export class ManifestDeploymentOptions extends React.Component<
|
|
|
62
56
|
value = 'bluegreen';
|
|
63
57
|
this.setState({ showRedBlackWarningMessage: true });
|
|
64
58
|
}
|
|
65
|
-
if (value === 'bluegreen' && this.props.isDeploymentKind) {
|
|
66
|
-
this.setState({ showBlueGreenDeploymentWarningMessage: true });
|
|
67
|
-
}
|
|
68
59
|
this.updateProps(key, value);
|
|
69
60
|
};
|
|
70
61
|
|
|
@@ -113,14 +104,10 @@ export class ManifestDeploymentOptions extends React.Component<
|
|
|
113
104
|
public componentDidMount() {
|
|
114
105
|
this.fetchServices();
|
|
115
106
|
this.setState({ showRedBlackWarningMessage: false });
|
|
116
|
-
this.setState({ showBlueGreenDeploymentWarningMessage: false });
|
|
117
107
|
if (this.props.config.options.strategy === 'redblack') {
|
|
118
108
|
this.setState({ showRedBlackWarningMessage: true });
|
|
119
109
|
this.updateProps('options.strategy', 'bluegreen');
|
|
120
110
|
}
|
|
121
|
-
if (this.props.config.options.strategy === 'bluegreen' && this.props.isDeploymentKind) {
|
|
122
|
-
this.setState({ showBlueGreenDeploymentWarningMessage: true });
|
|
123
|
-
}
|
|
124
111
|
}
|
|
125
112
|
|
|
126
113
|
public componentDidUpdate(prevProps: IManifestDeploymentOptionsProps) {
|
|
@@ -141,7 +128,6 @@ export class ManifestDeploymentOptions extends React.Component<
|
|
|
141
128
|
public render() {
|
|
142
129
|
const { config } = this.props;
|
|
143
130
|
const { showRedBlackWarningMessage } = this.state;
|
|
144
|
-
const { showBlueGreenDeploymentWarningMessage } = this.state;
|
|
145
131
|
return (
|
|
146
132
|
<>
|
|
147
133
|
<h4>Rollout Strategy Options</h4>
|
|
@@ -208,11 +194,6 @@ export class ManifestDeploymentOptions extends React.Component<
|
|
|
208
194
|
blue/green instead!
|
|
209
195
|
</p>
|
|
210
196
|
)}
|
|
211
|
-
{showBlueGreenDeploymentWarningMessage && (
|
|
212
|
-
<p id={'blueGreenWarning'} style={{ color: 'orange' }}>
|
|
213
|
-
Warning: Blue/Green strategy may cause downtime for Deployment kind!
|
|
214
|
-
</p>
|
|
215
|
-
)}
|
|
216
197
|
</StageConfigField>
|
|
217
198
|
</>
|
|
218
199
|
)}
|
|
@@ -2,12 +2,14 @@ import { get } from 'lodash';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import type { IExecutionDetailsSectionProps, IManifest } from '@spinnaker/core';
|
|
5
|
-
import { ExecutionDetailsSection, StageFailureMessage } from '@spinnaker/core';
|
|
5
|
+
import { CollapsibleElement, ExecutionDetailsSection, SETTINGS, StageFailureMessage } from '@spinnaker/core';
|
|
6
6
|
|
|
7
7
|
import { ManifestStatus } from './ManifestStatus';
|
|
8
8
|
import type { IStageManifest } from '../../../../manifest/manifest.service';
|
|
9
9
|
import { KubernetesManifestService } from '../../../../manifest/manifest.service';
|
|
10
10
|
|
|
11
|
+
import './DeployStatus.less';
|
|
12
|
+
|
|
11
13
|
export interface IManifestSubscription {
|
|
12
14
|
id: string;
|
|
13
15
|
unsubscribe: () => void;
|
|
@@ -87,22 +89,32 @@ export class DeployStatus extends React.Component<IExecutionDetailsSectionProps,
|
|
|
87
89
|
const { name: sectionName, current: currentSection, stage } = this.props;
|
|
88
90
|
const manifests: IManifest[] = this.state.subscriptions.filter((sub) => !!sub.manifest).map((sub) => sub.manifest);
|
|
89
91
|
return (
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
<div className="deploy-status">
|
|
93
|
+
<ExecutionDetailsSection name={sectionName} current={currentSection}>
|
|
94
|
+
{SETTINGS.feature.multiBlockFailureMessages ? (
|
|
95
|
+
stage.failureMessages.map((failureMessage) => (
|
|
96
|
+
<CollapsibleElement key={failureMessage} maxHeight={150}>
|
|
97
|
+
<StageFailureMessage stage={stage} message={failureMessage} />
|
|
98
|
+
</CollapsibleElement>
|
|
99
|
+
))
|
|
100
|
+
) : (
|
|
101
|
+
<StageFailureMessage stage={stage} message={stage.failureMessage} />
|
|
102
|
+
)}
|
|
103
|
+
{!!manifests?.length && (
|
|
104
|
+
<div className="row">
|
|
105
|
+
<div className="col-md-12">
|
|
106
|
+
<div className="well alert alert-info">
|
|
107
|
+
{manifests.map((manifest) => {
|
|
108
|
+
const uid =
|
|
109
|
+
manifest.manifest.metadata.uid || KubernetesManifestService.manifestIdentifier(manifest.manifest);
|
|
110
|
+
return <ManifestStatus key={uid} manifest={manifest} account={stage.context.account} />;
|
|
111
|
+
})}
|
|
112
|
+
</div>
|
|
101
113
|
</div>
|
|
102
114
|
</div>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
115
|
+
)}
|
|
116
|
+
</ExecutionDetailsSection>
|
|
117
|
+
</div>
|
|
106
118
|
);
|
|
107
119
|
}
|
|
108
120
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from './deleteManifest/deleteManifestStage';
|
|
2
2
|
export * from './deployManifest/deployManifestStage';
|
|
3
3
|
export * from './patchManifest/patchManifestStage';
|
|
4
|
+
export * from './rolloutRestartManifest/rolloutRestartManifestStage';
|
|
4
5
|
export * from './runJob/runJobStage';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defaults } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { Application, IStage, IStageConfigProps } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
import type { IManifestSelector } from '../../../manifest/selector/IManifestSelector';
|
|
7
|
+
import { SelectorMode } from '../../../manifest/selector/IManifestSelector';
|
|
8
|
+
import { ManifestSelector } from '../../../manifest/selector/ManifestSelector';
|
|
9
|
+
|
|
10
|
+
export interface IKubernetesManifestStageConfigProps extends IStageConfigProps {
|
|
11
|
+
application: Application;
|
|
12
|
+
stage: IManifestSelector & IStage;
|
|
13
|
+
stageFieldUpdated: () => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export class RolloutRestartManifestStageConfig extends React.Component<IKubernetesManifestStageConfigProps> {
|
|
17
|
+
public componentDidMount = (): void => {
|
|
18
|
+
defaults(this.props.stage, {
|
|
19
|
+
app: this.props.application.name,
|
|
20
|
+
cloudProvider: 'kubernetes',
|
|
21
|
+
});
|
|
22
|
+
this.props.stageFieldUpdated();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
private onChange = (stage: IManifestSelector): void => {
|
|
26
|
+
Object.assign(this.props.stage, stage);
|
|
27
|
+
this.props.stageFieldUpdated();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
public render() {
|
|
31
|
+
const selector = { ...this.props.stage };
|
|
32
|
+
return (
|
|
33
|
+
<div className="form-horizontal">
|
|
34
|
+
<h4>Manifest</h4>
|
|
35
|
+
<div className="horizontal-rule" />
|
|
36
|
+
<ManifestSelector
|
|
37
|
+
application={this.props.application}
|
|
38
|
+
selector={selector}
|
|
39
|
+
modes={[SelectorMode.Static, SelectorMode.Dynamic, SelectorMode.Label]}
|
|
40
|
+
onChange={this.onChange}
|
|
41
|
+
includeSpinnakerKinds={null}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExecutionDetailsTasks, Registry } from '@spinnaker/core';
|
|
2
|
+
|
|
3
|
+
import { RolloutRestartManifestStageConfig } from './RolloutRestartManifestStageConfig';
|
|
4
|
+
import { DeployStatus } from '../deployManifest/manifestStatus/DeployStatus';
|
|
5
|
+
import { manifestSelectorValidators } from '../validators/manifestSelectorValidators';
|
|
6
|
+
|
|
7
|
+
export class RolloutRestartStatus extends DeployStatus {
|
|
8
|
+
public static title = 'RolloutRestartStatus';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const STAGE_NAME = 'Rollout Restart (Manifest)';
|
|
12
|
+
Registry.pipeline.registerStage({
|
|
13
|
+
label: STAGE_NAME,
|
|
14
|
+
description: 'Perform a rolling restart of a manifest.',
|
|
15
|
+
key: 'rollingRestartManifest',
|
|
16
|
+
cloudProvider: 'kubernetes',
|
|
17
|
+
component: RolloutRestartManifestStageConfig,
|
|
18
|
+
executionDetailsSections: [RolloutRestartStatus, ExecutionDetailsTasks],
|
|
19
|
+
validators: manifestSelectorValidators(STAGE_NAME),
|
|
20
|
+
});
|
|
@@ -36,7 +36,7 @@ export class ManifestTrafficStageConfig extends React.Component<IKubernetesManif
|
|
|
36
36
|
selector={selector}
|
|
37
37
|
modes={[SelectorMode.Static, SelectorMode.Dynamic]}
|
|
38
38
|
onChange={this.onChange}
|
|
39
|
-
includeSpinnakerKinds={['serverGroups'
|
|
39
|
+
includeSpinnakerKinds={['serverGroups']}
|
|
40
40
|
/>
|
|
41
41
|
</div>
|
|
42
42
|
);
|