@spinnaker/kubernetes 0.0.0-main-2

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.
Files changed (286) hide show
  1. package/CHANGELOG.md +1663 -0
  2. package/LICENSE.txt +203 -0
  3. package/dist/help/kubernetes.help.d.ts +1 -0
  4. package/dist/index.d.ts +7 -0
  5. package/dist/index.js +6024 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/instance/details/details.controller.d.ts +1 -0
  8. package/dist/instance/index.d.ts +1 -0
  9. package/dist/interfaces/index.d.ts +1 -0
  10. package/dist/interfaces/infrastructure.types.d.ts +24 -0
  11. package/dist/kubernetes.module.d.ts +6 -0
  12. package/dist/loadBalancer/details/details.controller.d.ts +1 -0
  13. package/dist/loadBalancer/index.d.ts +1 -0
  14. package/dist/loadBalancer/transformer.d.ts +1 -0
  15. package/dist/manifest/IManifestCoordinates.d.ts +5 -0
  16. package/dist/manifest/ManifestImageDetails.d.ts +18 -0
  17. package/dist/manifest/ManifestKindSearch.d.ts +13 -0
  18. package/dist/manifest/ManifestLabels.d.ts +15 -0
  19. package/dist/manifest/ManifestQos.d.ts +15 -0
  20. package/dist/manifest/ManifestResources.d.ts +35 -0
  21. package/dist/manifest/ManifestSource.d.ts +4 -0
  22. package/dist/manifest/annotationCustomSections.component.d.ts +1 -0
  23. package/dist/manifest/artifact/artifact.component.d.ts +1 -0
  24. package/dist/manifest/delete/delete.controller.d.ts +12 -0
  25. package/dist/manifest/delete/deleteOptionsForm.component.d.ts +1 -0
  26. package/dist/manifest/editor/json/JsonEditor.d.ts +12 -0
  27. package/dist/manifest/editor/json/jsonEditor.component.d.ts +1 -0
  28. package/dist/manifest/index.d.ts +10 -0
  29. package/dist/manifest/manifest.service.d.ts +25 -0
  30. package/dist/manifest/manifestCommandBuilder.service.d.ts +30 -0
  31. package/dist/manifest/manifestEvents.component.d.ts +1 -0
  32. package/dist/manifest/manifestImageDetails.component.d.ts +1 -0
  33. package/dist/manifest/manifestLabels.component.d.ts +1 -0
  34. package/dist/manifest/manifestQos.component.d.ts +1 -0
  35. package/dist/manifest/manifestResources.component.d.ts +1 -0
  36. package/dist/manifest/rollout/RollingRestart.d.ts +1 -0
  37. package/dist/manifest/rollout/pause.controller.d.ts +1 -0
  38. package/dist/manifest/rollout/resume.controller.d.ts +1 -0
  39. package/dist/manifest/rollout/undo.controller.d.ts +1 -0
  40. package/dist/manifest/scale/ScaleSettingsForm.d.ts +10 -0
  41. package/dist/manifest/scale/scale.controller.d.ts +8 -0
  42. package/dist/manifest/scale/scaleSettingsForm.component.d.ts +1 -0
  43. package/dist/manifest/selector/IManifestLabelSelector.d.ts +9 -0
  44. package/dist/manifest/selector/IManifestSelector.d.ts +30 -0
  45. package/dist/manifest/selector/ManifestSelector.d.ts +46 -0
  46. package/dist/manifest/selector/labelEditor/LabelEditor.d.ts +15 -0
  47. package/dist/manifest/selector/selector.component.d.ts +1 -0
  48. package/dist/manifest/status/ManifestCondition.d.ts +13 -0
  49. package/dist/manifest/status/condition.component.d.ts +1 -0
  50. package/dist/manifest/status/status.component.d.ts +1 -0
  51. package/dist/manifest/traffic/ManifestTrafficService.d.ts +12 -0
  52. package/dist/manifest/wizard/BasicSettings.d.ts +17 -0
  53. package/dist/manifest/wizard/ManifestEntry.d.ts +16 -0
  54. package/dist/manifest/wizard/ManifestWizard.d.ts +22 -0
  55. package/dist/pipelines/stages/ManifestCoordinates.d.ts +31 -0
  56. package/dist/pipelines/stages/ManifestExecutionDetails.d.ts +69 -0
  57. package/dist/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.d.ts +18 -0
  58. package/dist/pipelines/stages/deleteManifest/DeleteManifestStageConfig.d.ts +14 -0
  59. package/dist/pipelines/stages/deleteManifest/deleteManifestStage.d.ts +1 -0
  60. package/dist/pipelines/stages/deployManifest/CopyFromTemplateButton.d.ts +15 -0
  61. package/dist/pipelines/stages/deployManifest/DeployManifestStageConfig.d.ts +15 -0
  62. package/dist/pipelines/stages/deployManifest/DeployManifestStageForm.d.ts +31 -0
  63. package/dist/pipelines/stages/deployManifest/ManifestBindArtifactsSelector.d.ts +17 -0
  64. package/dist/pipelines/stages/deployManifest/ManifestCopier.d.ts +36 -0
  65. package/dist/pipelines/stages/deployManifest/ManifestDeploymentOptions.d.ts +34 -0
  66. package/dist/pipelines/stages/deployManifest/NamespaceSelector.d.ts +16 -0
  67. package/dist/pipelines/stages/deployManifest/deployManifest.validator.d.ts +2 -0
  68. package/dist/pipelines/stages/deployManifest/deployManifestStage.d.ts +1 -0
  69. package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatus.d.ts +23 -0
  70. package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatusPills.d.ts +8 -0
  71. package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.d.ts +20 -0
  72. package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestEvents.d.ts +9 -0
  73. package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.d.ts +8 -0
  74. package/dist/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceConfig.d.ts +3 -0
  75. package/dist/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceStageForm.d.ts +7 -0
  76. package/dist/pipelines/stages/findArtifactsFromResource/findArtifactsFromResourceStage.d.ts +1 -0
  77. package/dist/pipelines/stages/index.d.ts +8 -0
  78. package/dist/pipelines/stages/patchManifest/PatchManifestOptionsForm.d.ts +8 -0
  79. package/dist/pipelines/stages/patchManifest/PatchManifestStageConfig.d.ts +7 -0
  80. package/dist/pipelines/stages/patchManifest/PatchManifestStageForm.d.ts +21 -0
  81. package/dist/pipelines/stages/patchManifest/patchManifestStage.d.ts +4 -0
  82. package/dist/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.d.ts +13 -0
  83. package/dist/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.d.ts +4 -0
  84. package/dist/pipelines/stages/runJob/KubernetesV2RunJobStageConfig.d.ts +31 -0
  85. package/dist/pipelines/stages/runJob/RunJobExecutionDetails.d.ts +7 -0
  86. package/dist/pipelines/stages/runJob/runJobStage.d.ts +1 -0
  87. package/dist/pipelines/stages/scaleManifest/ScaleManifestConfig.d.ts +3 -0
  88. package/dist/pipelines/stages/scaleManifest/ScaleManifestStageForm.d.ts +7 -0
  89. package/dist/pipelines/stages/scaleManifest/scaleManifestStage.d.ts +1 -0
  90. package/dist/pipelines/stages/traffic/ManifestTrafficStageConfig.d.ts +11 -0
  91. package/dist/pipelines/stages/traffic/disableManifest.stage.d.ts +1 -0
  92. package/dist/pipelines/stages/traffic/enableManifest.stage.d.ts +1 -0
  93. package/dist/pipelines/stages/undoRolloutManifest/UndoRolloutManifestConfig.d.ts +3 -0
  94. package/dist/pipelines/stages/undoRolloutManifest/UndoRolloutManifestStageForm.d.ts +7 -0
  95. package/dist/pipelines/stages/undoRolloutManifest/undoRolloutManifestStage.d.ts +1 -0
  96. package/dist/pipelines/stages/validators/manifestSelectorValidators.d.ts +2 -0
  97. package/dist/pipelines/validation/manifestSelector.validator.d.ts +8 -0
  98. package/dist/rawResource/component/K8sResources.d.ts +25 -0
  99. package/dist/rawResource/component/K8sResourcesFilters.d.ts +20 -0
  100. package/dist/rawResource/component/RawResourceUtils.d.ts +5 -0
  101. package/dist/rawResource/component/group/RawResouceGroup.d.ts +15 -0
  102. package/dist/rawResource/component/group/RawResource.d.ts +12 -0
  103. package/dist/rawResource/component/group/RawResourceDetails.d.ts +32 -0
  104. package/dist/rawResource/component/group/RawResourceGroups.d.ts +14 -0
  105. package/dist/rawResource/controller/FiltersPubSub.d.ts +12 -0
  106. package/dist/rawResource/index.d.ts +1 -0
  107. package/dist/rawResource/model/resource.d.ts +17 -0
  108. package/dist/rawResource/rawResource.dataSource.d.ts +2 -0
  109. package/dist/rawResource/rawResource.module.d.ts +1 -0
  110. package/dist/rawResource/rawResource.states.d.ts +6 -0
  111. package/dist/resources/ResourceDetails.d.ts +17 -0
  112. package/dist/resources/resources.state.d.ts +7 -0
  113. package/dist/rolloutStrategy/bluegreen.strategy.d.ts +2 -0
  114. package/dist/rolloutStrategy/highlander.strategy.d.ts +2 -0
  115. package/dist/rolloutStrategy/index.d.ts +1 -0
  116. package/dist/rolloutStrategy/none.strategy.d.ts +2 -0
  117. package/dist/rolloutStrategy/redblack.strategy.d.ts +2 -0
  118. package/dist/securityGroup/details/details.controller.d.ts +1 -0
  119. package/dist/securityGroup/index.d.ts +1 -0
  120. package/dist/securityGroup/securityGroup.reader.d.ts +4 -0
  121. package/dist/securityGroup/transformer.d.ts +1 -0
  122. package/dist/serverGroup/details/details.controller.d.ts +1 -0
  123. package/dist/serverGroup/details/resize/resize.controller.d.ts +1 -0
  124. package/dist/serverGroup/index.d.ts +4 -0
  125. package/dist/serverGroup/serverGroupCommandBuilder.service.d.ts +6 -0
  126. package/dist/serverGroup/serverGroupTransformer.service.d.ts +6 -0
  127. package/dist/serverGroupManager/details/details.controller.d.ts +1 -0
  128. package/dist/serverGroupManager/index.d.ts +1 -0
  129. package/dist/validation/applicationName.validator.d.ts +9 -0
  130. package/package.json +58 -0
  131. package/src/help/kubernetes.help.ts +236 -0
  132. package/src/index.ts +7 -0
  133. package/src/instance/details/details.controller.ts +186 -0
  134. package/src/instance/details/details.html +80 -0
  135. package/src/instance/index.ts +1 -0
  136. package/src/interfaces/index.ts +1 -0
  137. package/src/interfaces/infrastructure.types.ts +35 -0
  138. package/src/kubernetes.module.ts +144 -0
  139. package/src/loadBalancer/details/details.controller.ts +101 -0
  140. package/src/loadBalancer/details/details.html +187 -0
  141. package/src/loadBalancer/index.ts +1 -0
  142. package/src/loadBalancer/transformer.ts +60 -0
  143. package/src/logo/kubernetes.icon.svg +102 -0
  144. package/src/logo/kubernetes.logo.less +6 -0
  145. package/src/logo/kubernetes.logo.svg +1 -0
  146. package/src/manifest/IManifestCoordinates.ts +5 -0
  147. package/src/manifest/ManifestImageDetails.spec.tsx +76 -0
  148. package/src/manifest/ManifestImageDetails.tsx +64 -0
  149. package/src/manifest/ManifestKindSearch.tsx +31 -0
  150. package/src/manifest/ManifestLabels.tsx +31 -0
  151. package/src/manifest/ManifestQos.tsx +68 -0
  152. package/src/manifest/ManifestResources.tsx +69 -0
  153. package/src/manifest/ManifestSource.ts +4 -0
  154. package/src/manifest/annotationCustomSections.component.ts +114 -0
  155. package/src/manifest/artifact/artifact.component.ts +23 -0
  156. package/src/manifest/delete/delete.controller.ts +80 -0
  157. package/src/manifest/delete/delete.html +42 -0
  158. package/src/manifest/delete/deleteOptionsForm.component.ts +52 -0
  159. package/src/manifest/editor/json/JsonEditor.tsx +56 -0
  160. package/src/manifest/editor/json/jsonEditor.component.ts +12 -0
  161. package/src/manifest/index.ts +10 -0
  162. package/src/manifest/manifest.service.ts +90 -0
  163. package/src/manifest/manifestCommandBuilder.service.ts +126 -0
  164. package/src/manifest/manifestEvents.component.ts +12 -0
  165. package/src/manifest/manifestImageDetails.component.ts +12 -0
  166. package/src/manifest/manifestLabels.component.ts +12 -0
  167. package/src/manifest/manifestLabels.less +3 -0
  168. package/src/manifest/manifestQos.component.ts +12 -0
  169. package/src/manifest/manifestResources.component.ts +12 -0
  170. package/src/manifest/rollout/RollingRestart.tsx +54 -0
  171. package/src/manifest/rollout/pause.controller.ts +66 -0
  172. package/src/manifest/rollout/pause.html +28 -0
  173. package/src/manifest/rollout/resume.controller.ts +66 -0
  174. package/src/manifest/rollout/resume.html +28 -0
  175. package/src/manifest/rollout/undo.controller.ts +74 -0
  176. package/src/manifest/rollout/undo.html +44 -0
  177. package/src/manifest/scale/ScaleSettingsForm.tsx +43 -0
  178. package/src/manifest/scale/scale.controller.ts +75 -0
  179. package/src/manifest/scale/scale.html +32 -0
  180. package/src/manifest/scale/scaleSettingsForm.component.ts +11 -0
  181. package/src/manifest/selector/IManifestLabelSelector.ts +19 -0
  182. package/src/manifest/selector/IManifestSelector.ts +64 -0
  183. package/src/manifest/selector/ManifestSelector.spec.tsx +414 -0
  184. package/src/manifest/selector/ManifestSelector.tsx +424 -0
  185. package/src/manifest/selector/labelEditor/LabelEditor.spec.tsx +81 -0
  186. package/src/manifest/selector/labelEditor/LabelEditor.tsx +126 -0
  187. package/src/manifest/selector/labelEditor/labelEditor.less +3 -0
  188. package/src/manifest/selector/selector.component.ts +17 -0
  189. package/src/manifest/status/ManifestCondition.tsx +32 -0
  190. package/src/manifest/status/condition.component.ts +12 -0
  191. package/src/manifest/status/status.component.ts +36 -0
  192. package/src/manifest/traffic/ManifestTrafficService.spec.ts +30 -0
  193. package/src/manifest/traffic/ManifestTrafficService.ts +67 -0
  194. package/src/manifest/wizard/BasicSettings.tsx +57 -0
  195. package/src/manifest/wizard/ManifestEntry.tsx +46 -0
  196. package/src/manifest/wizard/ManifestWizard.tsx +94 -0
  197. package/src/pipelines/stages/ManifestCoordinates.spec.tsx +90 -0
  198. package/src/pipelines/stages/ManifestCoordinates.tsx +128 -0
  199. package/src/pipelines/stages/ManifestExecutionDetails.tsx +58 -0
  200. package/src/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.spec.tsx +85 -0
  201. package/src/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.tsx +87 -0
  202. package/src/pipelines/stages/deleteManifest/DeleteManifestStageConfig.tsx +62 -0
  203. package/src/pipelines/stages/deleteManifest/deleteManifestOptionsForm.less +9 -0
  204. package/src/pipelines/stages/deleteManifest/deleteManifestStage.ts +21 -0
  205. package/src/pipelines/stages/deployManifest/CopyFromTemplateButton.tsx +45 -0
  206. package/src/pipelines/stages/deployManifest/DeployManifestStageConfig.tsx +77 -0
  207. package/src/pipelines/stages/deployManifest/DeployManifestStageForm.tsx +265 -0
  208. package/src/pipelines/stages/deployManifest/ManifestBindArtifactsSelector.tsx +69 -0
  209. package/src/pipelines/stages/deployManifest/ManifestCopier.spec.ts +110 -0
  210. package/src/pipelines/stages/deployManifest/ManifestCopier.tsx +222 -0
  211. package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.spec.tsx +75 -0
  212. package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.tsx +203 -0
  213. package/src/pipelines/stages/deployManifest/NamespaceSelector.tsx +40 -0
  214. package/src/pipelines/stages/deployManifest/deployManifest.validator.ts +38 -0
  215. package/src/pipelines/stages/deployManifest/deployManifestStage.ts +28 -0
  216. package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.less +11 -0
  217. package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.tsx +120 -0
  218. package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatusPills.tsx +47 -0
  219. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.tsx +92 -0
  220. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestEvents.tsx +87 -0
  221. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.less +24 -0
  222. package/src/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.tsx +46 -0
  223. package/src/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceConfig.tsx +35 -0
  224. package/src/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceStageForm.tsx +37 -0
  225. package/src/pipelines/stages/findArtifactsFromResource/findArtifactsFromResourceStage.ts +21 -0
  226. package/src/pipelines/stages/index.ts +8 -0
  227. package/src/pipelines/stages/patchManifest/PatchManifestOptionsForm.tsx +35 -0
  228. package/src/pipelines/stages/patchManifest/PatchManifestStageConfig.tsx +57 -0
  229. package/src/pipelines/stages/patchManifest/PatchManifestStageForm.tsx +157 -0
  230. package/src/pipelines/stages/patchManifest/patchManifestStage.ts +30 -0
  231. package/src/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.tsx +46 -0
  232. package/src/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.ts +20 -0
  233. package/src/pipelines/stages/runJob/KubernetesV2RunJobStageConfig.tsx +242 -0
  234. package/src/pipelines/stages/runJob/RunJobExecutionDetails.tsx +67 -0
  235. package/src/pipelines/stages/runJob/runJobStage.ts +39 -0
  236. package/src/pipelines/stages/scaleManifest/ScaleManifestConfig.tsx +38 -0
  237. package/src/pipelines/stages/scaleManifest/ScaleManifestStageForm.tsx +46 -0
  238. package/src/pipelines/stages/scaleManifest/scaleManifestStage.ts +24 -0
  239. package/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx +44 -0
  240. package/src/pipelines/stages/traffic/disableManifest.stage.ts +26 -0
  241. package/src/pipelines/stages/traffic/enableManifest.stage.ts +26 -0
  242. package/src/pipelines/stages/undoRolloutManifest/UndoRolloutManifestConfig.tsx +37 -0
  243. package/src/pipelines/stages/undoRolloutManifest/UndoRolloutManifestStageForm.tsx +60 -0
  244. package/src/pipelines/stages/undoRolloutManifest/undoRolloutManifestStage.ts +21 -0
  245. package/src/pipelines/stages/validators/manifestSelectorValidators.ts +43 -0
  246. package/src/pipelines/validation/manifestSelector.validator.ts +36 -0
  247. package/src/rawResource/component/K8sResources.less +9 -0
  248. package/src/rawResource/component/K8sResources.tsx +112 -0
  249. package/src/rawResource/component/K8sResourcesFilters.tsx +112 -0
  250. package/src/rawResource/component/RawResourceUtils.ts +19 -0
  251. package/src/rawResource/component/group/RawResouceGroup.tsx +41 -0
  252. package/src/rawResource/component/group/RawResource.less +79 -0
  253. package/src/rawResource/component/group/RawResource.tsx +51 -0
  254. package/src/rawResource/component/group/RawResourceDetails.tsx +236 -0
  255. package/src/rawResource/component/group/RawResourceGroups.tsx +53 -0
  256. package/src/rawResource/controller/FiltersPubSub.ts +35 -0
  257. package/src/rawResource/index.ts +1 -0
  258. package/src/rawResource/model/resource.ts +18 -0
  259. package/src/rawResource/rawResource.dataSource.ts +39 -0
  260. package/src/rawResource/rawResource.module.ts +8 -0
  261. package/src/rawResource/rawResource.states.ts +64 -0
  262. package/src/resources/ResourceDetails.tsx +121 -0
  263. package/src/resources/resources.state.ts +45 -0
  264. package/src/rolloutStrategy/bluegreen.strategy.ts +7 -0
  265. package/src/rolloutStrategy/highlander.strategy.ts +7 -0
  266. package/src/rolloutStrategy/index.ts +6 -0
  267. package/src/rolloutStrategy/none.strategy.ts +8 -0
  268. package/src/rolloutStrategy/redblack.strategy.ts +7 -0
  269. package/src/securityGroup/details/details.controller.ts +118 -0
  270. package/src/securityGroup/details/details.html +91 -0
  271. package/src/securityGroup/index.ts +1 -0
  272. package/src/securityGroup/securityGroup.reader.ts +11 -0
  273. package/src/securityGroup/transformer.ts +19 -0
  274. package/src/serverGroup/details/details.controller.ts +207 -0
  275. package/src/serverGroup/details/details.html +153 -0
  276. package/src/serverGroup/details/resize/resize.controller.ts +73 -0
  277. package/src/serverGroup/details/resize/resize.html +57 -0
  278. package/src/serverGroup/index.ts +4 -0
  279. package/src/serverGroup/serverGroupCommandBuilder.service.ts +18 -0
  280. package/src/serverGroup/serverGroupTransformer.service.spec.ts +67 -0
  281. package/src/serverGroup/serverGroupTransformer.service.ts +34 -0
  282. package/src/serverGroupManager/details/details.controller.ts +191 -0
  283. package/src/serverGroupManager/details/details.html +136 -0
  284. package/src/serverGroupManager/index.ts +1 -0
  285. package/src/validation/applicationName.validator.spec.ts +19 -0
  286. package/src/validation/applicationName.validator.ts +44 -0
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import type { Option } from 'react-select';
3
+ import Select from 'react-select';
4
+
5
+ import { CheckboxInput, StageConfigField } from '@spinnaker/core';
6
+
7
+ export interface IPatchManifestOptionsFormProps {
8
+ record: boolean;
9
+ onRecordChange: (record: boolean) => void;
10
+ strategy: string;
11
+ onStrategyChange: (strategy: string) => void;
12
+ }
13
+
14
+ export const PatchManifestOptionsForm: React.FunctionComponent<IPatchManifestOptionsFormProps> = (
15
+ props: IPatchManifestOptionsFormProps,
16
+ ) => {
17
+ return (
18
+ <div className="form-horizontal">
19
+ <StageConfigField label="Record Patch Annotation" helpKey="kubernetes.manifest.patch.record">
20
+ <CheckboxInput
21
+ checked={props.record}
22
+ onChange={(e: React.ChangeEvent<HTMLInputElement>) => props.onRecordChange(e.target.checked)}
23
+ />
24
+ </StageConfigField>
25
+ <StageConfigField label="Merge Strategy" helpKey="kubernetes.manifest.patch.mergeStrategy" fieldColumns={3}>
26
+ <Select
27
+ clearable={false}
28
+ value={props.strategy}
29
+ options={['strategic', 'json', 'merge'].map((k) => ({ value: k, label: k }))}
30
+ onChange={(e: Option<string>) => props.onStrategyChange(e.value)}
31
+ />
32
+ </StageConfigField>
33
+ </div>
34
+ );
35
+ };
@@ -0,0 +1,57 @@
1
+ import { defaults } from 'lodash';
2
+ import React from 'react';
3
+
4
+ import type { IStage, IStageConfigProps } from '@spinnaker/core';
5
+ import { FormikStageConfig } from '@spinnaker/core';
6
+
7
+ import { PatchManifestStageForm } from './PatchManifestStageForm';
8
+ import { ManifestSource } from '../../../manifest/ManifestSource';
9
+
10
+ export class PatchManifestStageConfig extends React.Component<IStageConfigProps> {
11
+ private readonly stage: IStage;
12
+
13
+ public constructor(props: IStageConfigProps) {
14
+ super(props);
15
+ defaults(props.stage, {
16
+ app: props.application.name,
17
+ source: ManifestSource.TEXT,
18
+ options: {
19
+ record: true,
20
+ mergeStrategy: 'strategic',
21
+ },
22
+ cloudProvider: 'kubernetes',
23
+ });
24
+
25
+ // There was a bug introduced in Spinnaker 1.15 where we were incorrectly
26
+ // storing the merge strategy on a field called 'strategy' instead of on
27
+ // 'mergeStrategy'. In order to auto-fix pipelines affected by that bug,
28
+ // delete any value in 'strategy'. If 'mergeStrategy' is empty, set it to
29
+ // the value we deleted from 'strategy'.
30
+ defaults(props.stage.options, {
31
+ mergeStrategy: props.stage.options.strategy,
32
+ });
33
+ delete props.stage.options.strategy;
34
+
35
+ // There was a bug introduced in Spinnaker 1.15 where we were incorrectly
36
+ // always storing the patchBody as an object. In order to auto-fix pipelines
37
+ // affected by that bug, massage any configured patchBody value into a list.
38
+ if (props.stage.patchBody && !Array.isArray(props.stage.patchBody)) {
39
+ props.stage.patchBody = [props.stage.patchBody];
40
+ }
41
+
42
+ // Intentionally initializing the stage config only once in the constructor
43
+ // The stage config is then completely owned within FormikStageConfig's Formik state
44
+ this.stage = props.stage;
45
+ }
46
+
47
+ public render() {
48
+ return (
49
+ <FormikStageConfig
50
+ {...this.props}
51
+ stage={this.stage}
52
+ onChange={this.props.updateStage}
53
+ render={(props) => <PatchManifestStageForm {...props} stageFieldUpdated={this.props.stageFieldUpdated} />}
54
+ />
55
+ );
56
+ }
57
+ }
@@ -0,0 +1,157 @@
1
+ import { capitalize, get, isEmpty, map } from 'lodash';
2
+ import React from 'react';
3
+ import type { Option } from 'react-select';
4
+
5
+ import type { IArtifact, IExpectedArtifact, IFormikStageConfigInjectedProps } from '@spinnaker/core';
6
+ import {
7
+ ArtifactTypePatterns,
8
+ RadioButtonInput,
9
+ StageArtifactSelectorDelegate,
10
+ StageConfigField,
11
+ yamlDocumentsToString,
12
+ YamlEditor,
13
+ } from '@spinnaker/core';
14
+
15
+ import { PatchManifestOptionsForm } from './PatchManifestOptionsForm';
16
+ import { ManifestBindArtifactsSelector } from '../deployManifest/ManifestBindArtifactsSelector';
17
+ import type { IManifestBindArtifact } from '../deployManifest/ManifestBindArtifactsSelector';
18
+ import { ManifestSource } from '../../../manifest/ManifestSource';
19
+ import { SelectorMode } from '../../../manifest/selector/IManifestSelector';
20
+ import { ManifestSelector } from '../../../manifest/selector/ManifestSelector';
21
+
22
+ interface IPatchManifestStageConfigFormProps {
23
+ stageFieldUpdated: () => void;
24
+ }
25
+
26
+ interface IPatchManifestStageConfigFormState {
27
+ rawManifest: string;
28
+ }
29
+
30
+ export class PatchManifestStageForm extends React.Component<
31
+ IPatchManifestStageConfigFormProps & IFormikStageConfigInjectedProps,
32
+ IPatchManifestStageConfigFormState
33
+ > {
34
+ private readonly excludedManifestArtifactTypes = [
35
+ ArtifactTypePatterns.DOCKER_IMAGE,
36
+ ArtifactTypePatterns.KUBERNETES,
37
+ ArtifactTypePatterns.FRONT50_PIPELINE_TEMPLATE,
38
+ ArtifactTypePatterns.EMBEDDED_BASE64,
39
+ ArtifactTypePatterns.MAVEN_FILE,
40
+ ];
41
+
42
+ public constructor(props: IPatchManifestStageConfigFormProps & IFormikStageConfigInjectedProps) {
43
+ super(props);
44
+ const patchBody: any[] = get(props.formik.values, 'patchBody');
45
+ const isTextManifest: boolean = get(props.formik.values, 'source') === ManifestSource.TEXT;
46
+ this.state = {
47
+ rawManifest: !isEmpty(patchBody) && isTextManifest ? yamlDocumentsToString(patchBody) : '',
48
+ };
49
+ }
50
+
51
+ private onManifestArtifactSelected = (expectedArtifactId: string): void => {
52
+ this.props.formik.setFieldValue('manifestArtifactId', expectedArtifactId);
53
+ this.props.formik.setFieldValue('manifestArtifact', null);
54
+ };
55
+
56
+ private onManifestArtifactEdited = (artifact: IArtifact) => {
57
+ this.props.formik.setFieldValue('manifestArtifactId', null);
58
+ this.props.formik.setFieldValue('manifestArtifact', artifact);
59
+ };
60
+
61
+ private getRequiredArtifacts = (): IManifestBindArtifact[] => {
62
+ const { requiredArtifactIds, requiredArtifacts } = this.props.formik.values;
63
+ return (requiredArtifactIds || [])
64
+ .map((id: string) => ({ expectedArtifactId: id }))
65
+ .concat(requiredArtifacts || []);
66
+ };
67
+
68
+ private onRequiredArtifactsChanged = (bindings: IManifestBindArtifact[]): void => {
69
+ this.props.formik.setFieldValue(
70
+ 'requiredArtifactIds',
71
+ bindings.filter((b) => b.expectedArtifactId).map((b) => b.expectedArtifactId),
72
+ );
73
+ this.props.formik.setFieldValue(
74
+ 'requiredArtifacts',
75
+ bindings.filter((b) => b.artifact),
76
+ );
77
+ };
78
+
79
+ private handleRawManifestChange = (rawManifest: string, manifests: any): void => {
80
+ this.setState({
81
+ rawManifest,
82
+ });
83
+ this.props.formik.setFieldValue('patchBody', manifests);
84
+ };
85
+
86
+ private onManifestSelectorChange = (): void => {
87
+ this.props.stageFieldUpdated();
88
+ };
89
+
90
+ private getSourceOptions = (): Array<Option<string>> => {
91
+ return map([ManifestSource.TEXT, ManifestSource.ARTIFACT], (option) => ({
92
+ label: capitalize(option),
93
+ value: option,
94
+ }));
95
+ };
96
+
97
+ public render() {
98
+ const stage = this.props.formik.values;
99
+ return (
100
+ <div className="container-fluid form-horizontal">
101
+ <h4>Resource to Patch</h4>
102
+ <ManifestSelector
103
+ application={this.props.application}
104
+ modes={[SelectorMode.Static, SelectorMode.Dynamic]}
105
+ onChange={this.onManifestSelectorChange}
106
+ selector={stage as any}
107
+ />
108
+ <hr />
109
+ <h4>Patch Content</h4>
110
+ <StageConfigField label="Manifest Source" helpKey="kubernetes.manifest.source">
111
+ <RadioButtonInput
112
+ options={this.getSourceOptions()}
113
+ onChange={(e: any) => this.props.formik.setFieldValue('source', e.target.value)}
114
+ value={stage.source}
115
+ />
116
+ </StageConfigField>
117
+ {stage.source === ManifestSource.TEXT && (
118
+ <StageConfigField label="Manifest">
119
+ <YamlEditor onChange={this.handleRawManifestChange} value={this.state.rawManifest} />
120
+ </StageConfigField>
121
+ )}
122
+ {stage.source === ManifestSource.ARTIFACT && (
123
+ <>
124
+ <StageArtifactSelectorDelegate
125
+ artifact={stage.manifestArtifact}
126
+ excludedArtifactTypePatterns={this.excludedManifestArtifactTypes}
127
+ expectedArtifactId={stage.manifestArtifactId}
128
+ helpKey="kubernetes.manifest.expectedArtifact"
129
+ label="Manifest Artifact"
130
+ onArtifactEdited={this.onManifestArtifactEdited}
131
+ onExpectedArtifactSelected={(artifact: IExpectedArtifact) => this.onManifestArtifactSelected(artifact.id)}
132
+ pipeline={this.props.pipeline}
133
+ stage={stage}
134
+ />
135
+ </>
136
+ )}
137
+ <StageConfigField label="Required Artifacts to Bind" helpKey="kubernetes.manifest.requiredArtifactsToBind">
138
+ <ManifestBindArtifactsSelector
139
+ bindings={this.getRequiredArtifacts()}
140
+ onChangeBindings={this.onRequiredArtifactsChanged}
141
+ pipeline={this.props.pipeline}
142
+ stage={stage}
143
+ />
144
+ </StageConfigField>
145
+
146
+ <hr />
147
+ <h4>Patch Options</h4>
148
+ <PatchManifestOptionsForm
149
+ strategy={!!stage.options && stage.options.mergeStrategy}
150
+ onStrategyChange={(strategy: string) => this.props.formik.setFieldValue('options.mergeStrategy', strategy)}
151
+ record={!!stage.options && stage.options.record}
152
+ onRecordChange={(record: boolean) => this.props.formik.setFieldValue('options.record', record)}
153
+ />
154
+ </div>
155
+ );
156
+ }
157
+ }
@@ -0,0 +1,30 @@
1
+ import {
2
+ ArtifactReferenceService,
3
+ ExecutionArtifactTab,
4
+ ExecutionDetailsTasks,
5
+ ExpectedArtifactService,
6
+ Registry,
7
+ } from '@spinnaker/core';
8
+
9
+ import { PatchManifestStageConfig } from './PatchManifestStageConfig';
10
+ import { DeployStatus } from '../deployManifest/manifestStatus/DeployStatus';
11
+ import { manifestSelectorValidators } from '../validators/manifestSelectorValidators';
12
+
13
+ export class PatchStatus extends DeployStatus {
14
+ public static title = 'PatchStatus';
15
+ }
16
+
17
+ const STAGE_NAME = 'Patch (Manifest)';
18
+ Registry.pipeline.registerStage({
19
+ label: STAGE_NAME,
20
+ description: 'Patch a Kubernetes object in place.',
21
+ key: 'patchManifest',
22
+ cloudProvider: 'kubernetes',
23
+ component: PatchManifestStageConfig,
24
+ executionDetailsSections: [PatchStatus, ExecutionDetailsTasks, ExecutionArtifactTab],
25
+ producesArtifacts: true,
26
+ supportsCustomTimeout: true,
27
+ validators: manifestSelectorValidators(STAGE_NAME),
28
+ artifactExtractor: ExpectedArtifactService.accumulateArtifacts(['manifestArtifactId', 'requiredArtifactIds']),
29
+ artifactRemover: ArtifactReferenceService.removeArtifactFromFields(['manifestArtifactId', 'requiredArtifactIds']),
30
+ });
@@ -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
+ });
@@ -0,0 +1,242 @@
1
+ import { capitalize, map } from 'lodash';
2
+ import React from 'react';
3
+ import type { Option } from 'react-select';
4
+ import Select from 'react-select';
5
+
6
+ import type { IAccount, IArtifact, IExpectedArtifact, IStageConfigProps } from '@spinnaker/core';
7
+ import {
8
+ AccountService,
9
+ ArtifactTypePatterns,
10
+ RadioButtonInput,
11
+ StageArtifactSelector,
12
+ StageArtifactSelectorDelegate,
13
+ StageConfigField,
14
+ yamlDocumentsToString,
15
+ YamlEditor,
16
+ } from '@spinnaker/core';
17
+
18
+ import { ManifestBindArtifactsSelector } from '../deployManifest/ManifestBindArtifactsSelector';
19
+ import type { IManifestBindArtifact } from '../deployManifest/ManifestBindArtifactsSelector';
20
+ import { ManifestSource } from '../../../manifest/ManifestSource';
21
+ import { ManifestBasicSettings } from '../../../manifest/wizard/BasicSettings';
22
+
23
+ export interface IKubernetesRunJobStageConfigState {
24
+ credentials: IAccount[];
25
+ rawManifest?: string;
26
+ }
27
+
28
+ export class KubernetesV2RunJobStageConfig extends React.Component<IStageConfigProps> {
29
+ public state: IKubernetesRunJobStageConfigState = {
30
+ credentials: [],
31
+ };
32
+
33
+ private readonly excludedManifestArtifactTypes = [
34
+ ArtifactTypePatterns.DOCKER_IMAGE,
35
+ ArtifactTypePatterns.KUBERNETES,
36
+ ArtifactTypePatterns.FRONT50_PIPELINE_TEMPLATE,
37
+ ArtifactTypePatterns.MAVEN_FILE,
38
+ ];
39
+
40
+ constructor(props: IStageConfigProps) {
41
+ super(props);
42
+ const { stage, application } = this.props;
43
+ if (!stage.application) {
44
+ stage.application = application.name;
45
+ }
46
+ if (!stage.source) {
47
+ stage.source = ManifestSource.TEXT;
48
+ }
49
+ }
50
+
51
+ public outputOptions = [
52
+ { label: 'None', value: 'none' },
53
+ { label: 'Logs', value: 'propertyFile' },
54
+ { label: 'Artifact', value: 'artifact' },
55
+ ];
56
+
57
+ public accountChanged = (account: string) => {
58
+ this.props.updateStageField({
59
+ credentials: account,
60
+ account: account,
61
+ });
62
+ };
63
+
64
+ public handleRawManifestChange = (rawManifest: string, manifests: any) => {
65
+ if (manifests) {
66
+ this.props.updateStageField({ manifest: manifests[0] });
67
+ }
68
+ this.setState({ rawManifest });
69
+ };
70
+
71
+ public initRawManifest() {
72
+ const { stage } = this.props;
73
+ if (stage.manifest) {
74
+ this.setState({ rawManifest: yamlDocumentsToString([stage.manifest]) });
75
+ }
76
+ }
77
+
78
+ public componentDidMount() {
79
+ this.props.updateStageField({ cloudProvider: 'kubernetes' });
80
+ AccountService.getAllAccountDetailsForProvider('kubernetes').then((accounts: any) => {
81
+ this.setState({ credentials: accounts });
82
+ });
83
+ this.initRawManifest();
84
+ }
85
+
86
+ private sourceChanged = (event: any) => {
87
+ this.props.updateStageField({ consumeArtifactSource: event.value });
88
+ if (event.value === 'none') {
89
+ this.props.updateStageField({ propertyFile: null });
90
+ }
91
+ };
92
+
93
+ private onArtifactSelected = (artifact: IExpectedArtifact) => {
94
+ this.props.updateStageField({ consumeArtifactId: artifact.id });
95
+ };
96
+
97
+ private onArtifactEdited = (artifact: IArtifact) => {
98
+ this.props.updateStageField({
99
+ consumeArtifact: artifact,
100
+ consumeArtifactId: artifact.id,
101
+ consumeArtifactAccount: artifact.artifactAccount,
102
+ });
103
+ };
104
+
105
+ private onManifestArtifactSelected = (expectedArtifactId: string): void => {
106
+ this.props.updateStageField({
107
+ manifestArtifactId: expectedArtifactId,
108
+ manifestArtifact: null,
109
+ });
110
+ };
111
+
112
+ private onManifestArtifactEdited = (artifact: IArtifact) => {
113
+ this.props.updateStageField({
114
+ manifestArtifactId: null,
115
+ manifestArtifact: artifact,
116
+ });
117
+ };
118
+
119
+ private updatePropertyFile = (event: any) => {
120
+ this.props.updateStageField({ propertyFile: event.target.value });
121
+ };
122
+
123
+ public logSourceForm() {
124
+ const { stage } = this.props;
125
+ return (
126
+ <StageConfigField label="Container Name" helpKey="kubernetes.runJob.captureSource.containerName">
127
+ <input
128
+ className="form-control input-sm"
129
+ type="text"
130
+ value={stage.propertyFile}
131
+ onChange={this.updatePropertyFile}
132
+ />
133
+ </StageConfigField>
134
+ );
135
+ }
136
+
137
+ public artifactForm() {
138
+ const { stage, pipeline } = this.props;
139
+ return (
140
+ <StageConfigField label="Artifact">
141
+ <StageArtifactSelector
142
+ pipeline={pipeline}
143
+ stage={stage}
144
+ artifact={stage.consumeArtifact}
145
+ excludedArtifactTypePatterns={[]}
146
+ expectedArtifactId={stage.consumeArtifactId}
147
+ onExpectedArtifactSelected={this.onArtifactSelected}
148
+ onArtifactEdited={this.onArtifactEdited}
149
+ />
150
+ </StageConfigField>
151
+ );
152
+ }
153
+
154
+ private getSourceOptions = (): Array<Option<string>> => {
155
+ return map([ManifestSource.TEXT, ManifestSource.ARTIFACT], (option) => ({
156
+ label: capitalize(option),
157
+ value: option,
158
+ }));
159
+ };
160
+
161
+ private getRequiredArtifacts = (): IManifestBindArtifact[] => {
162
+ const { requiredArtifactIds, requiredArtifacts } = this.props.stage;
163
+ return (requiredArtifactIds || [])
164
+ .map((id: string) => ({ expectedArtifactId: id }))
165
+ .concat(requiredArtifacts || []);
166
+ };
167
+
168
+ private onRequiredArtifactsChanged = (bindings: IManifestBindArtifact[]): void => {
169
+ this.props.updateStageField({
170
+ requiredArtifactIds: bindings.filter((b) => b.expectedArtifactId).map((b) => b.expectedArtifactId),
171
+ });
172
+ this.props.updateStageField({ requiredArtifacts: bindings.filter((b) => b.artifact) });
173
+ };
174
+
175
+ public render() {
176
+ const { stage } = this.props;
177
+
178
+ let outputSource = <div />;
179
+ if (stage.consumeArtifactSource === 'propertyFile') {
180
+ outputSource = this.logSourceForm();
181
+ } else if (stage.consumeArtifactSource === 'artifact') {
182
+ outputSource = this.artifactForm();
183
+ }
184
+
185
+ return (
186
+ <div className="container-fluid form-horizontal">
187
+ <h4>Basic Settings</h4>
188
+ <ManifestBasicSettings
189
+ selectedAccount={stage.account || ''}
190
+ accounts={this.state.credentials}
191
+ onAccountSelect={(selectedAccount: string) => this.accountChanged(selectedAccount)}
192
+ />
193
+ <h4>Manifest Configuration</h4>
194
+ <StageConfigField label="Manifest Source" helpKey="kubernetes.manifest.source">
195
+ <RadioButtonInput
196
+ options={this.getSourceOptions()}
197
+ onChange={(e: any) => this.props.updateStageField({ source: e.target.value })}
198
+ value={stage.source}
199
+ />
200
+ </StageConfigField>
201
+ {stage.source === ManifestSource.TEXT && (
202
+ <YamlEditor value={this.state.rawManifest} onChange={this.handleRawManifestChange} />
203
+ )}
204
+ {stage.source === ManifestSource.ARTIFACT && (
205
+ <>
206
+ <StageArtifactSelectorDelegate
207
+ artifact={stage.manifestArtifact}
208
+ excludedArtifactTypePatterns={this.excludedManifestArtifactTypes}
209
+ expectedArtifactId={stage.manifestArtifactId}
210
+ helpKey="kubernetes.manifest.expectedArtifact"
211
+ label="Manifest Artifact"
212
+ onArtifactEdited={this.onManifestArtifactEdited}
213
+ onExpectedArtifactSelected={(artifact: IExpectedArtifact) => this.onManifestArtifactSelected(artifact.id)}
214
+ pipeline={this.props.pipeline}
215
+ stage={stage}
216
+ />
217
+ </>
218
+ )}
219
+ <StageConfigField label="Required Artifacts to Bind" helpKey="kubernetes.manifest.requiredArtifactsToBind">
220
+ <ManifestBindArtifactsSelector
221
+ bindings={this.getRequiredArtifacts()}
222
+ onChangeBindings={this.onRequiredArtifactsChanged}
223
+ pipeline={this.props.pipeline}
224
+ stage={stage}
225
+ />
226
+ </StageConfigField>
227
+ <h4>Output</h4>
228
+ <StageConfigField label="Capture Output From" helpKey="kubernetes.runJob.captureSource">
229
+ <div>
230
+ <Select
231
+ clearable={false}
232
+ options={this.outputOptions}
233
+ value={stage.consumeArtifactSource}
234
+ onChange={this.sourceChanged}
235
+ />
236
+ </div>
237
+ </StageConfigField>
238
+ {outputSource}
239
+ </div>
240
+ );
241
+ }
242
+ }
@@ -0,0 +1,67 @@
1
+ import { get, isEmpty, sortBy } from 'lodash';
2
+ import React from 'react';
3
+
4
+ import type { IExecutionDetailsSectionProps, IJobOwnedPodStatus } from '@spinnaker/core';
5
+ import {
6
+ AccountTag,
7
+ DefaultPodNameProvider,
8
+ ExecutionDetailsSection,
9
+ JobStageExecutionLogs,
10
+ StageFailureMessage,
11
+ } from '@spinnaker/core';
12
+
13
+ export class RunJobExecutionDetails extends React.Component<IExecutionDetailsSectionProps, any> {
14
+ public static title = 'runJobConfig';
15
+
16
+ private createdPodNames(podsStatuses: IJobOwnedPodStatus[]): string[] {
17
+ const sorted = sortBy(podsStatuses, (p: IJobOwnedPodStatus) => p.status.startTime);
18
+ return sorted.map((p: IJobOwnedPodStatus) => p.name);
19
+ }
20
+
21
+ public render() {
22
+ const { stage, name, current } = this.props;
23
+ const { context } = stage;
24
+ const namespace = get(stage, ['context', 'jobStatus', 'location'], '');
25
+ const deployedName = namespace ? get<string[]>(context, ['deploy.jobs', namespace])[0] : '';
26
+ const externalLink = get<string>(stage, ['context', 'execution', 'logs']);
27
+ const pods = get(stage.context, 'jobStatus.pods', []);
28
+ const podNames = !isEmpty(pods)
29
+ ? this.createdPodNames(pods)
30
+ : [get(stage, ['context', 'jobStatus', 'mostRecentPodName'], '')];
31
+ const podNamesProviders = podNames.map((p) => new DefaultPodNameProvider(p));
32
+
33
+ return (
34
+ <ExecutionDetailsSection name={name} current={current}>
35
+ <StageFailureMessage stage={stage} message={stage.failureMessage} />
36
+ <div className="row">
37
+ <div className="col-md-9">
38
+ <dl className="dl-narrow dl-horizontal">
39
+ <dt>Account</dt>
40
+ <dd>
41
+ <AccountTag account={context.account} />
42
+ </dd>
43
+ {namespace && (
44
+ <>
45
+ <dt>Namespace</dt>
46
+ <dd>{stage.context.jobStatus.location}</dd>
47
+ <dt>Logs</dt>
48
+ <dd>
49
+ <JobStageExecutionLogs
50
+ deployedName={deployedName}
51
+ account={this.props.stage.context.account}
52
+ location={namespace}
53
+ application={this.props.application}
54
+ externalLink={externalLink}
55
+ podNamesProviders={podNamesProviders}
56
+ />
57
+ </dd>
58
+ </>
59
+ )}
60
+ {!namespace && <div className="well">Collecting additional details...</div>}
61
+ </dl>
62
+ </div>
63
+ </div>
64
+ </ExecutionDetailsSection>
65
+ );
66
+ }
67
+ }