@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.
- package/CHANGELOG.md +1663 -0
- package/LICENSE.txt +203 -0
- package/dist/help/kubernetes.help.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +6024 -0
- package/dist/index.js.map +1 -0
- package/dist/instance/details/details.controller.d.ts +1 -0
- package/dist/instance/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/infrastructure.types.d.ts +24 -0
- package/dist/kubernetes.module.d.ts +6 -0
- package/dist/loadBalancer/details/details.controller.d.ts +1 -0
- package/dist/loadBalancer/index.d.ts +1 -0
- package/dist/loadBalancer/transformer.d.ts +1 -0
- package/dist/manifest/IManifestCoordinates.d.ts +5 -0
- package/dist/manifest/ManifestImageDetails.d.ts +18 -0
- package/dist/manifest/ManifestKindSearch.d.ts +13 -0
- package/dist/manifest/ManifestLabels.d.ts +15 -0
- package/dist/manifest/ManifestQos.d.ts +15 -0
- package/dist/manifest/ManifestResources.d.ts +35 -0
- package/dist/manifest/ManifestSource.d.ts +4 -0
- package/dist/manifest/annotationCustomSections.component.d.ts +1 -0
- package/dist/manifest/artifact/artifact.component.d.ts +1 -0
- package/dist/manifest/delete/delete.controller.d.ts +12 -0
- package/dist/manifest/delete/deleteOptionsForm.component.d.ts +1 -0
- package/dist/manifest/editor/json/JsonEditor.d.ts +12 -0
- package/dist/manifest/editor/json/jsonEditor.component.d.ts +1 -0
- package/dist/manifest/index.d.ts +10 -0
- package/dist/manifest/manifest.service.d.ts +25 -0
- package/dist/manifest/manifestCommandBuilder.service.d.ts +30 -0
- package/dist/manifest/manifestEvents.component.d.ts +1 -0
- package/dist/manifest/manifestImageDetails.component.d.ts +1 -0
- package/dist/manifest/manifestLabels.component.d.ts +1 -0
- package/dist/manifest/manifestQos.component.d.ts +1 -0
- package/dist/manifest/manifestResources.component.d.ts +1 -0
- package/dist/manifest/rollout/RollingRestart.d.ts +1 -0
- package/dist/manifest/rollout/pause.controller.d.ts +1 -0
- package/dist/manifest/rollout/resume.controller.d.ts +1 -0
- package/dist/manifest/rollout/undo.controller.d.ts +1 -0
- package/dist/manifest/scale/ScaleSettingsForm.d.ts +10 -0
- package/dist/manifest/scale/scale.controller.d.ts +8 -0
- package/dist/manifest/scale/scaleSettingsForm.component.d.ts +1 -0
- package/dist/manifest/selector/IManifestLabelSelector.d.ts +9 -0
- package/dist/manifest/selector/IManifestSelector.d.ts +30 -0
- package/dist/manifest/selector/ManifestSelector.d.ts +46 -0
- package/dist/manifest/selector/labelEditor/LabelEditor.d.ts +15 -0
- package/dist/manifest/selector/selector.component.d.ts +1 -0
- package/dist/manifest/status/ManifestCondition.d.ts +13 -0
- package/dist/manifest/status/condition.component.d.ts +1 -0
- package/dist/manifest/status/status.component.d.ts +1 -0
- package/dist/manifest/traffic/ManifestTrafficService.d.ts +12 -0
- package/dist/manifest/wizard/BasicSettings.d.ts +17 -0
- package/dist/manifest/wizard/ManifestEntry.d.ts +16 -0
- package/dist/manifest/wizard/ManifestWizard.d.ts +22 -0
- package/dist/pipelines/stages/ManifestCoordinates.d.ts +31 -0
- package/dist/pipelines/stages/ManifestExecutionDetails.d.ts +69 -0
- package/dist/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.d.ts +18 -0
- package/dist/pipelines/stages/deleteManifest/DeleteManifestStageConfig.d.ts +14 -0
- package/dist/pipelines/stages/deleteManifest/deleteManifestStage.d.ts +1 -0
- package/dist/pipelines/stages/deployManifest/CopyFromTemplateButton.d.ts +15 -0
- package/dist/pipelines/stages/deployManifest/DeployManifestStageConfig.d.ts +15 -0
- package/dist/pipelines/stages/deployManifest/DeployManifestStageForm.d.ts +31 -0
- package/dist/pipelines/stages/deployManifest/ManifestBindArtifactsSelector.d.ts +17 -0
- package/dist/pipelines/stages/deployManifest/ManifestCopier.d.ts +36 -0
- package/dist/pipelines/stages/deployManifest/ManifestDeploymentOptions.d.ts +34 -0
- package/dist/pipelines/stages/deployManifest/NamespaceSelector.d.ts +16 -0
- package/dist/pipelines/stages/deployManifest/deployManifest.validator.d.ts +2 -0
- package/dist/pipelines/stages/deployManifest/deployManifestStage.d.ts +1 -0
- package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatus.d.ts +23 -0
- package/dist/pipelines/stages/deployManifest/manifestStatus/DeployStatusPills.d.ts +8 -0
- package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.d.ts +20 -0
- package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestEvents.d.ts +9 -0
- package/dist/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.d.ts +8 -0
- package/dist/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceConfig.d.ts +3 -0
- package/dist/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceStageForm.d.ts +7 -0
- package/dist/pipelines/stages/findArtifactsFromResource/findArtifactsFromResourceStage.d.ts +1 -0
- package/dist/pipelines/stages/index.d.ts +8 -0
- package/dist/pipelines/stages/patchManifest/PatchManifestOptionsForm.d.ts +8 -0
- package/dist/pipelines/stages/patchManifest/PatchManifestStageConfig.d.ts +7 -0
- package/dist/pipelines/stages/patchManifest/PatchManifestStageForm.d.ts +21 -0
- package/dist/pipelines/stages/patchManifest/patchManifestStage.d.ts +4 -0
- package/dist/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.d.ts +13 -0
- package/dist/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.d.ts +4 -0
- package/dist/pipelines/stages/runJob/KubernetesV2RunJobStageConfig.d.ts +31 -0
- package/dist/pipelines/stages/runJob/RunJobExecutionDetails.d.ts +7 -0
- package/dist/pipelines/stages/runJob/runJobStage.d.ts +1 -0
- package/dist/pipelines/stages/scaleManifest/ScaleManifestConfig.d.ts +3 -0
- package/dist/pipelines/stages/scaleManifest/ScaleManifestStageForm.d.ts +7 -0
- package/dist/pipelines/stages/scaleManifest/scaleManifestStage.d.ts +1 -0
- package/dist/pipelines/stages/traffic/ManifestTrafficStageConfig.d.ts +11 -0
- package/dist/pipelines/stages/traffic/disableManifest.stage.d.ts +1 -0
- package/dist/pipelines/stages/traffic/enableManifest.stage.d.ts +1 -0
- package/dist/pipelines/stages/undoRolloutManifest/UndoRolloutManifestConfig.d.ts +3 -0
- package/dist/pipelines/stages/undoRolloutManifest/UndoRolloutManifestStageForm.d.ts +7 -0
- package/dist/pipelines/stages/undoRolloutManifest/undoRolloutManifestStage.d.ts +1 -0
- package/dist/pipelines/stages/validators/manifestSelectorValidators.d.ts +2 -0
- package/dist/pipelines/validation/manifestSelector.validator.d.ts +8 -0
- package/dist/rawResource/component/K8sResources.d.ts +25 -0
- package/dist/rawResource/component/K8sResourcesFilters.d.ts +20 -0
- package/dist/rawResource/component/RawResourceUtils.d.ts +5 -0
- package/dist/rawResource/component/group/RawResouceGroup.d.ts +15 -0
- package/dist/rawResource/component/group/RawResource.d.ts +12 -0
- package/dist/rawResource/component/group/RawResourceDetails.d.ts +32 -0
- package/dist/rawResource/component/group/RawResourceGroups.d.ts +14 -0
- package/dist/rawResource/controller/FiltersPubSub.d.ts +12 -0
- package/dist/rawResource/index.d.ts +1 -0
- package/dist/rawResource/model/resource.d.ts +17 -0
- package/dist/rawResource/rawResource.dataSource.d.ts +2 -0
- package/dist/rawResource/rawResource.module.d.ts +1 -0
- package/dist/rawResource/rawResource.states.d.ts +6 -0
- package/dist/resources/ResourceDetails.d.ts +17 -0
- package/dist/resources/resources.state.d.ts +7 -0
- package/dist/rolloutStrategy/bluegreen.strategy.d.ts +2 -0
- package/dist/rolloutStrategy/highlander.strategy.d.ts +2 -0
- package/dist/rolloutStrategy/index.d.ts +1 -0
- package/dist/rolloutStrategy/none.strategy.d.ts +2 -0
- package/dist/rolloutStrategy/redblack.strategy.d.ts +2 -0
- package/dist/securityGroup/details/details.controller.d.ts +1 -0
- package/dist/securityGroup/index.d.ts +1 -0
- package/dist/securityGroup/securityGroup.reader.d.ts +4 -0
- package/dist/securityGroup/transformer.d.ts +1 -0
- package/dist/serverGroup/details/details.controller.d.ts +1 -0
- package/dist/serverGroup/details/resize/resize.controller.d.ts +1 -0
- package/dist/serverGroup/index.d.ts +4 -0
- package/dist/serverGroup/serverGroupCommandBuilder.service.d.ts +6 -0
- package/dist/serverGroup/serverGroupTransformer.service.d.ts +6 -0
- package/dist/serverGroupManager/details/details.controller.d.ts +1 -0
- package/dist/serverGroupManager/index.d.ts +1 -0
- package/dist/validation/applicationName.validator.d.ts +9 -0
- package/package.json +58 -0
- package/src/help/kubernetes.help.ts +236 -0
- package/src/index.ts +7 -0
- package/src/instance/details/details.controller.ts +186 -0
- package/src/instance/details/details.html +80 -0
- package/src/instance/index.ts +1 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interfaces/infrastructure.types.ts +35 -0
- package/src/kubernetes.module.ts +144 -0
- package/src/loadBalancer/details/details.controller.ts +101 -0
- package/src/loadBalancer/details/details.html +187 -0
- package/src/loadBalancer/index.ts +1 -0
- package/src/loadBalancer/transformer.ts +60 -0
- package/src/logo/kubernetes.icon.svg +102 -0
- package/src/logo/kubernetes.logo.less +6 -0
- package/src/logo/kubernetes.logo.svg +1 -0
- package/src/manifest/IManifestCoordinates.ts +5 -0
- package/src/manifest/ManifestImageDetails.spec.tsx +76 -0
- package/src/manifest/ManifestImageDetails.tsx +64 -0
- package/src/manifest/ManifestKindSearch.tsx +31 -0
- package/src/manifest/ManifestLabels.tsx +31 -0
- package/src/manifest/ManifestQos.tsx +68 -0
- package/src/manifest/ManifestResources.tsx +69 -0
- package/src/manifest/ManifestSource.ts +4 -0
- package/src/manifest/annotationCustomSections.component.ts +114 -0
- package/src/manifest/artifact/artifact.component.ts +23 -0
- package/src/manifest/delete/delete.controller.ts +80 -0
- package/src/manifest/delete/delete.html +42 -0
- package/src/manifest/delete/deleteOptionsForm.component.ts +52 -0
- package/src/manifest/editor/json/JsonEditor.tsx +56 -0
- package/src/manifest/editor/json/jsonEditor.component.ts +12 -0
- package/src/manifest/index.ts +10 -0
- package/src/manifest/manifest.service.ts +90 -0
- package/src/manifest/manifestCommandBuilder.service.ts +126 -0
- package/src/manifest/manifestEvents.component.ts +12 -0
- package/src/manifest/manifestImageDetails.component.ts +12 -0
- package/src/manifest/manifestLabels.component.ts +12 -0
- package/src/manifest/manifestLabels.less +3 -0
- package/src/manifest/manifestQos.component.ts +12 -0
- package/src/manifest/manifestResources.component.ts +12 -0
- package/src/manifest/rollout/RollingRestart.tsx +54 -0
- package/src/manifest/rollout/pause.controller.ts +66 -0
- package/src/manifest/rollout/pause.html +28 -0
- package/src/manifest/rollout/resume.controller.ts +66 -0
- package/src/manifest/rollout/resume.html +28 -0
- package/src/manifest/rollout/undo.controller.ts +74 -0
- package/src/manifest/rollout/undo.html +44 -0
- package/src/manifest/scale/ScaleSettingsForm.tsx +43 -0
- package/src/manifest/scale/scale.controller.ts +75 -0
- package/src/manifest/scale/scale.html +32 -0
- package/src/manifest/scale/scaleSettingsForm.component.ts +11 -0
- package/src/manifest/selector/IManifestLabelSelector.ts +19 -0
- package/src/manifest/selector/IManifestSelector.ts +64 -0
- package/src/manifest/selector/ManifestSelector.spec.tsx +414 -0
- package/src/manifest/selector/ManifestSelector.tsx +424 -0
- package/src/manifest/selector/labelEditor/LabelEditor.spec.tsx +81 -0
- package/src/manifest/selector/labelEditor/LabelEditor.tsx +126 -0
- package/src/manifest/selector/labelEditor/labelEditor.less +3 -0
- package/src/manifest/selector/selector.component.ts +17 -0
- package/src/manifest/status/ManifestCondition.tsx +32 -0
- package/src/manifest/status/condition.component.ts +12 -0
- package/src/manifest/status/status.component.ts +36 -0
- package/src/manifest/traffic/ManifestTrafficService.spec.ts +30 -0
- package/src/manifest/traffic/ManifestTrafficService.ts +67 -0
- package/src/manifest/wizard/BasicSettings.tsx +57 -0
- package/src/manifest/wizard/ManifestEntry.tsx +46 -0
- package/src/manifest/wizard/ManifestWizard.tsx +94 -0
- package/src/pipelines/stages/ManifestCoordinates.spec.tsx +90 -0
- package/src/pipelines/stages/ManifestCoordinates.tsx +128 -0
- package/src/pipelines/stages/ManifestExecutionDetails.tsx +58 -0
- package/src/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.spec.tsx +85 -0
- package/src/pipelines/stages/deleteManifest/DeleteManifestOptionsForm.tsx +87 -0
- package/src/pipelines/stages/deleteManifest/DeleteManifestStageConfig.tsx +62 -0
- package/src/pipelines/stages/deleteManifest/deleteManifestOptionsForm.less +9 -0
- package/src/pipelines/stages/deleteManifest/deleteManifestStage.ts +21 -0
- package/src/pipelines/stages/deployManifest/CopyFromTemplateButton.tsx +45 -0
- package/src/pipelines/stages/deployManifest/DeployManifestStageConfig.tsx +77 -0
- package/src/pipelines/stages/deployManifest/DeployManifestStageForm.tsx +265 -0
- package/src/pipelines/stages/deployManifest/ManifestBindArtifactsSelector.tsx +69 -0
- package/src/pipelines/stages/deployManifest/ManifestCopier.spec.ts +110 -0
- package/src/pipelines/stages/deployManifest/ManifestCopier.tsx +222 -0
- package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.spec.tsx +75 -0
- package/src/pipelines/stages/deployManifest/ManifestDeploymentOptions.tsx +203 -0
- package/src/pipelines/stages/deployManifest/NamespaceSelector.tsx +40 -0
- package/src/pipelines/stages/deployManifest/deployManifest.validator.ts +38 -0
- package/src/pipelines/stages/deployManifest/deployManifestStage.ts +28 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.less +11 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatus.tsx +120 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/DeployStatusPills.tsx +47 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/ManifestDetailsLink.tsx +92 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/ManifestEvents.tsx +87 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.less +24 -0
- package/src/pipelines/stages/deployManifest/manifestStatus/ManifestStatus.tsx +46 -0
- package/src/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceConfig.tsx +35 -0
- package/src/pipelines/stages/findArtifactsFromResource/FindArtifactsFromResourceStageForm.tsx +37 -0
- package/src/pipelines/stages/findArtifactsFromResource/findArtifactsFromResourceStage.ts +21 -0
- package/src/pipelines/stages/index.ts +8 -0
- package/src/pipelines/stages/patchManifest/PatchManifestOptionsForm.tsx +35 -0
- package/src/pipelines/stages/patchManifest/PatchManifestStageConfig.tsx +57 -0
- package/src/pipelines/stages/patchManifest/PatchManifestStageForm.tsx +157 -0
- package/src/pipelines/stages/patchManifest/patchManifestStage.ts +30 -0
- package/src/pipelines/stages/rolloutRestartManifest/RolloutRestartManifestStageConfig.tsx +46 -0
- package/src/pipelines/stages/rolloutRestartManifest/rolloutRestartManifestStage.ts +20 -0
- package/src/pipelines/stages/runJob/KubernetesV2RunJobStageConfig.tsx +242 -0
- package/src/pipelines/stages/runJob/RunJobExecutionDetails.tsx +67 -0
- package/src/pipelines/stages/runJob/runJobStage.ts +39 -0
- package/src/pipelines/stages/scaleManifest/ScaleManifestConfig.tsx +38 -0
- package/src/pipelines/stages/scaleManifest/ScaleManifestStageForm.tsx +46 -0
- package/src/pipelines/stages/scaleManifest/scaleManifestStage.ts +24 -0
- package/src/pipelines/stages/traffic/ManifestTrafficStageConfig.tsx +44 -0
- package/src/pipelines/stages/traffic/disableManifest.stage.ts +26 -0
- package/src/pipelines/stages/traffic/enableManifest.stage.ts +26 -0
- package/src/pipelines/stages/undoRolloutManifest/UndoRolloutManifestConfig.tsx +37 -0
- package/src/pipelines/stages/undoRolloutManifest/UndoRolloutManifestStageForm.tsx +60 -0
- package/src/pipelines/stages/undoRolloutManifest/undoRolloutManifestStage.ts +21 -0
- package/src/pipelines/stages/validators/manifestSelectorValidators.ts +43 -0
- package/src/pipelines/validation/manifestSelector.validator.ts +36 -0
- package/src/rawResource/component/K8sResources.less +9 -0
- package/src/rawResource/component/K8sResources.tsx +112 -0
- package/src/rawResource/component/K8sResourcesFilters.tsx +112 -0
- package/src/rawResource/component/RawResourceUtils.ts +19 -0
- package/src/rawResource/component/group/RawResouceGroup.tsx +41 -0
- package/src/rawResource/component/group/RawResource.less +79 -0
- package/src/rawResource/component/group/RawResource.tsx +51 -0
- package/src/rawResource/component/group/RawResourceDetails.tsx +236 -0
- package/src/rawResource/component/group/RawResourceGroups.tsx +53 -0
- package/src/rawResource/controller/FiltersPubSub.ts +35 -0
- package/src/rawResource/index.ts +1 -0
- package/src/rawResource/model/resource.ts +18 -0
- package/src/rawResource/rawResource.dataSource.ts +39 -0
- package/src/rawResource/rawResource.module.ts +8 -0
- package/src/rawResource/rawResource.states.ts +64 -0
- package/src/resources/ResourceDetails.tsx +121 -0
- package/src/resources/resources.state.ts +45 -0
- package/src/rolloutStrategy/bluegreen.strategy.ts +7 -0
- package/src/rolloutStrategy/highlander.strategy.ts +7 -0
- package/src/rolloutStrategy/index.ts +6 -0
- package/src/rolloutStrategy/none.strategy.ts +8 -0
- package/src/rolloutStrategy/redblack.strategy.ts +7 -0
- package/src/securityGroup/details/details.controller.ts +118 -0
- package/src/securityGroup/details/details.html +91 -0
- package/src/securityGroup/index.ts +1 -0
- package/src/securityGroup/securityGroup.reader.ts +11 -0
- package/src/securityGroup/transformer.ts +19 -0
- package/src/serverGroup/details/details.controller.ts +207 -0
- package/src/serverGroup/details/details.html +153 -0
- package/src/serverGroup/details/resize/resize.controller.ts +73 -0
- package/src/serverGroup/details/resize/resize.html +57 -0
- package/src/serverGroup/index.ts +4 -0
- package/src/serverGroup/serverGroupCommandBuilder.service.ts +18 -0
- package/src/serverGroup/serverGroupTransformer.service.spec.ts +67 -0
- package/src/serverGroup/serverGroupTransformer.service.ts +34 -0
- package/src/serverGroupManager/details/details.controller.ts +191 -0
- package/src/serverGroupManager/details/details.html +136 -0
- package/src/serverGroupManager/index.ts +1 -0
- package/src/validation/applicationName.validator.spec.ts +19 -0
- package/src/validation/applicationName.validator.ts +44 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
import { react2angular } from 'react2angular';
|
|
3
|
+
|
|
4
|
+
import { withErrorBoundary } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
import { ManifestCondition } from './ManifestCondition';
|
|
7
|
+
|
|
8
|
+
export const KUBERNETES_MANIFEST_CONDITION = 'spinnaker.kubernetes.v2.manifest.condition.component';
|
|
9
|
+
module(KUBERNETES_MANIFEST_CONDITION, []).component(
|
|
10
|
+
'kubernetesManifestCondition',
|
|
11
|
+
react2angular(withErrorBoundary(ManifestCondition, 'kubernetesManifestCondition'), ['condition']),
|
|
12
|
+
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { IComponentOptions, IController } from 'angular';
|
|
2
|
+
import { module } from 'angular';
|
|
3
|
+
|
|
4
|
+
import type { IManifestStatus } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
class KubernetesManifestStatusCtrl implements IController {
|
|
7
|
+
public status: IManifestStatus;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const kubernetesManifestStatusComponent: IComponentOptions = {
|
|
11
|
+
bindings: { status: '<' },
|
|
12
|
+
controller: KubernetesManifestStatusCtrl,
|
|
13
|
+
controllerAs: 'ctrl',
|
|
14
|
+
template: `
|
|
15
|
+
<div ng-if="!ctrl.status" class="horizontal middle center spinner-section">
|
|
16
|
+
<loading-spinner size="'small'"></loading-spinner>
|
|
17
|
+
</div>
|
|
18
|
+
<div ng-if="ctrl.status">
|
|
19
|
+
<div class="band band-warning" ng-if="!ctrl.status.available.state"
|
|
20
|
+
uib-tooltip="{{ctrl.status.available.message}}">
|
|
21
|
+
Not Fully Available
|
|
22
|
+
</div>
|
|
23
|
+
<div class="band band-active" ng-if="!ctrl.status.stable.state"
|
|
24
|
+
uib-tooltip="{{ctrl.status.stable.message}}">
|
|
25
|
+
Transitioning
|
|
26
|
+
</div>
|
|
27
|
+
<div class="band band-info" ng-if="ctrl.status.paused.state"
|
|
28
|
+
uib-tooltip="{{ctrl.status.paused.message}}">
|
|
29
|
+
Rollout Paused
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const KUBERNETES_MANIFEST_STATUS = 'spinnaker.kubernetes.v2.kubernetes.manifest.status.component';
|
|
36
|
+
module(KUBERNETES_MANIFEST_STATUS, []).component('kubernetesManifestStatus', kubernetesManifestStatusComponent);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ManifestTrafficService } from '../../manifest/traffic/ManifestTrafficService';
|
|
2
|
+
|
|
3
|
+
describe('Service: ManifestTrafficService', () => {
|
|
4
|
+
it('will not disable an already disabled server group', () => {
|
|
5
|
+
const canDisable = ManifestTrafficService.canDisableServerGroup({
|
|
6
|
+
disabled: true,
|
|
7
|
+
serverGroupManagers: [],
|
|
8
|
+
loadBalancers: ['service my-service'],
|
|
9
|
+
} as any);
|
|
10
|
+
expect(canDisable).toEqual(false);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('will not disable a server group without load balancers', () => {
|
|
14
|
+
const canDisable = ManifestTrafficService.canDisableServerGroup({
|
|
15
|
+
disabled: false,
|
|
16
|
+
serverGroupManagers: [],
|
|
17
|
+
loadBalancers: [],
|
|
18
|
+
} as any);
|
|
19
|
+
expect(canDisable).toEqual(false);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('will not disable a managed server group', () => {
|
|
23
|
+
const canDisable = ManifestTrafficService.canDisableServerGroup({
|
|
24
|
+
disabled: false,
|
|
25
|
+
serverGroupManagers: ['deployment my-deployment'],
|
|
26
|
+
loadBalancers: ['service my-service'],
|
|
27
|
+
} as any);
|
|
28
|
+
expect(canDisable).toEqual(false);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Application, IManifest, ITask } from '@spinnaker/core';
|
|
2
|
+
import { TaskExecutor } from '@spinnaker/core';
|
|
3
|
+
|
|
4
|
+
import type { IKubernetesServerGroup } from '../../interfaces';
|
|
5
|
+
|
|
6
|
+
export class ManifestTrafficService {
|
|
7
|
+
public static readonly ENABLE_MANIFEST_OPERATION = 'enableManifest';
|
|
8
|
+
public static readonly DISABLE_MANIFEST_OPERATION = 'disableManifest';
|
|
9
|
+
|
|
10
|
+
public static enable = (manifest: IManifest, application: Application, reason?: string): PromiseLike<ITask> => {
|
|
11
|
+
return TaskExecutor.executeTask({
|
|
12
|
+
job: [
|
|
13
|
+
{
|
|
14
|
+
account: manifest.account,
|
|
15
|
+
cloudProvider: 'kubernetes',
|
|
16
|
+
location: manifest.location,
|
|
17
|
+
manifestName: manifest.name,
|
|
18
|
+
type: ManifestTrafficService.ENABLE_MANIFEST_OPERATION,
|
|
19
|
+
reason,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
application,
|
|
23
|
+
description: `Enable Manifest: ${manifest.name}`,
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
public static disable = (manifest: IManifest, application: Application, reason?: string): PromiseLike<ITask> => {
|
|
28
|
+
return TaskExecutor.executeTask({
|
|
29
|
+
job: [
|
|
30
|
+
{
|
|
31
|
+
account: manifest.account,
|
|
32
|
+
cloudProvider: 'kubernetes',
|
|
33
|
+
location: manifest.location,
|
|
34
|
+
manifestName: manifest.name,
|
|
35
|
+
type: ManifestTrafficService.DISABLE_MANIFEST_OPERATION,
|
|
36
|
+
reason,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
application,
|
|
40
|
+
description: `Disable Manifest: ${manifest.name}`,
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
public static canDisableServerGroup = (serverGroup: IKubernetesServerGroup): boolean => {
|
|
45
|
+
return (
|
|
46
|
+
ManifestTrafficService.hasLoadBalancers(serverGroup) &&
|
|
47
|
+
!ManifestTrafficService.isManaged(serverGroup) &&
|
|
48
|
+
!serverGroup.disabled
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
public static canEnableServerGroup = (serverGroup: IKubernetesServerGroup): boolean => {
|
|
53
|
+
return (
|
|
54
|
+
ManifestTrafficService.hasLoadBalancers(serverGroup) &&
|
|
55
|
+
!ManifestTrafficService.isManaged(serverGroup) &&
|
|
56
|
+
serverGroup.disabled
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
private static hasLoadBalancers = (serverGroup: IKubernetesServerGroup): boolean => {
|
|
61
|
+
return serverGroup.loadBalancers?.length > 0;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
private static isManaged = (serverGroup: IKubernetesServerGroup): boolean => {
|
|
65
|
+
return serverGroup.serverGroupManagers && serverGroup.serverGroupManagers.length > 0;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { FormikProps } from 'formik';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { IAccount } from '@spinnaker/core';
|
|
5
|
+
import { AccountSelectInput, HelpField } from '@spinnaker/core';
|
|
6
|
+
|
|
7
|
+
import type { IKubernetesManifestCommandData } from '../manifestCommandBuilder.service';
|
|
8
|
+
|
|
9
|
+
export interface IManifestBasicSettingsProps {
|
|
10
|
+
accounts: IAccount[];
|
|
11
|
+
onAccountSelect: (account: string) => void;
|
|
12
|
+
selectedAccount: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function ManifestBasicSettings({ accounts, onAccountSelect, selectedAccount }: IManifestBasicSettingsProps) {
|
|
16
|
+
return (
|
|
17
|
+
<div className="form-horizontal">
|
|
18
|
+
<div className="form-group">
|
|
19
|
+
<div className="col-md-3 sm-label-right">
|
|
20
|
+
Account <HelpField id="kubernetes.manifest.account" />
|
|
21
|
+
</div>
|
|
22
|
+
<div className="col-md-7">
|
|
23
|
+
<AccountSelectInput
|
|
24
|
+
value={selectedAccount}
|
|
25
|
+
onChange={(evt: any) => onAccountSelect(evt.target.value)}
|
|
26
|
+
readOnly={false}
|
|
27
|
+
accounts={accounts}
|
|
28
|
+
provider="kubernetes"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface IWizardManifestBasicSettingsProps {
|
|
37
|
+
formik: FormikProps<IKubernetesManifestCommandData>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class WizardManifestBasicSettings extends React.Component<IWizardManifestBasicSettingsProps> {
|
|
41
|
+
private accountUpdated = (account: string): void => {
|
|
42
|
+
const { formik } = this.props;
|
|
43
|
+
formik.values.command.account = account;
|
|
44
|
+
formik.setFieldValue('account', account);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
public render() {
|
|
48
|
+
const { formik } = this.props;
|
|
49
|
+
return (
|
|
50
|
+
<ManifestBasicSettings
|
|
51
|
+
accounts={formik.values.metadata.backingData.accounts}
|
|
52
|
+
onAccountSelect={this.accountUpdated}
|
|
53
|
+
selectedAccount={formik.values.command.account}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { FormikProps } from 'formik';
|
|
2
|
+
import { dump } from 'js-yaml';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import type { Application } from '@spinnaker/core';
|
|
6
|
+
import { YamlEditor } from '@spinnaker/core';
|
|
7
|
+
|
|
8
|
+
import type { IKubernetesManifestCommandData } from '../manifestCommandBuilder.service';
|
|
9
|
+
|
|
10
|
+
export interface IManifestBasicSettingsProps {
|
|
11
|
+
app: Application;
|
|
12
|
+
formik: FormikProps<IKubernetesManifestCommandData>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface IManifestBasicSettingsState {
|
|
16
|
+
rawManifest: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export class ManifestEntry extends React.Component<IManifestBasicSettingsProps, IManifestBasicSettingsState> {
|
|
20
|
+
constructor(props: IManifestBasicSettingsProps) {
|
|
21
|
+
super(props);
|
|
22
|
+
|
|
23
|
+
const { values } = this.props.formik;
|
|
24
|
+
const [first = null, ...rest] = values.command.manifests || [];
|
|
25
|
+
const manifest = rest && rest.length ? values.command.manifests : first;
|
|
26
|
+
try {
|
|
27
|
+
this.state = {
|
|
28
|
+
rawManifest: manifest ? dump(manifest) : null,
|
|
29
|
+
};
|
|
30
|
+
} catch (e) {
|
|
31
|
+
this.state = { rawManifest: null };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private handleChange = (rawManifest: string, manifest: any) => {
|
|
36
|
+
this.props.formik.setFieldValue(
|
|
37
|
+
'command.manifests',
|
|
38
|
+
[].concat(manifest).filter((x) => !!x),
|
|
39
|
+
);
|
|
40
|
+
this.setState({ rawManifest });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
public render() {
|
|
44
|
+
return <YamlEditor value={this.state.rawManifest} onChange={this.handleChange} />;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { Application, IModalComponentProps } from '@spinnaker/core';
|
|
4
|
+
import { ManifestWriter, noop, ReactModal, TaskMonitor, WizardModal, WizardPage } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
import { WizardManifestBasicSettings } from './BasicSettings';
|
|
7
|
+
import { ManifestEntry } from './ManifestEntry';
|
|
8
|
+
import type { IKubernetesManifestCommandData } from '../manifestCommandBuilder.service';
|
|
9
|
+
import { KubernetesManifestCommandBuilder } from '../manifestCommandBuilder.service';
|
|
10
|
+
|
|
11
|
+
export interface IKubernetesManifestModalProps extends IModalComponentProps {
|
|
12
|
+
title: string;
|
|
13
|
+
application: Application;
|
|
14
|
+
command: IKubernetesManifestCommandData;
|
|
15
|
+
isNew?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IKubernetesManifestModalState {
|
|
19
|
+
command: IKubernetesManifestCommandData;
|
|
20
|
+
loaded: boolean;
|
|
21
|
+
taskMonitor: TaskMonitor;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class ManifestWizard extends React.Component<IKubernetesManifestModalProps, IKubernetesManifestModalState> {
|
|
25
|
+
public static defaultProps: Partial<IKubernetesManifestModalProps> = {
|
|
26
|
+
closeModal: noop,
|
|
27
|
+
dismissModal: noop,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
public static show(props: IKubernetesManifestModalProps): Promise<IKubernetesManifestCommandData> {
|
|
31
|
+
const modalProps = { dialogClassName: 'wizard-modal modal-lg' };
|
|
32
|
+
return ReactModal.show(ManifestWizard, props, modalProps);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
constructor(props: IKubernetesManifestModalProps) {
|
|
36
|
+
super(props);
|
|
37
|
+
if (!props.command) {
|
|
38
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(props.application).then((command) => {
|
|
39
|
+
Object.assign(this.state.command, command);
|
|
40
|
+
this.setState({ loaded: true });
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
this.state = {
|
|
45
|
+
loaded: !!props.command,
|
|
46
|
+
command: props.command || ({} as IKubernetesManifestCommandData),
|
|
47
|
+
taskMonitor: new TaskMonitor({
|
|
48
|
+
application: props.application,
|
|
49
|
+
title: `${this.props.isNew ? 'Deploying' : 'Updating'} your manifest`,
|
|
50
|
+
modalInstance: TaskMonitor.modalInstanceEmulation(() => this.props.dismissModal()),
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
private submit = (c: IKubernetesManifestCommandData): void => {
|
|
56
|
+
const command = KubernetesManifestCommandBuilder.copyAndCleanCommand(c.command);
|
|
57
|
+
const submitMethod = () => ManifestWriter.deployManifest(command, this.props.application);
|
|
58
|
+
this.state.taskMonitor.submit(submitMethod);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
public render() {
|
|
62
|
+
const { application, dismissModal, isNew } = this.props;
|
|
63
|
+
const { loaded, taskMonitor, command } = this.state;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<WizardModal<IKubernetesManifestCommandData>
|
|
67
|
+
heading={`${isNew ? 'Deploy' : 'Update'} Manifest`}
|
|
68
|
+
initialValues={command}
|
|
69
|
+
loading={!loaded}
|
|
70
|
+
taskMonitor={taskMonitor}
|
|
71
|
+
dismissModal={dismissModal}
|
|
72
|
+
closeModal={this.submit}
|
|
73
|
+
submitButtonLabel={isNew ? 'Create' : 'Edit'}
|
|
74
|
+
render={({ formik, nextIdx, wizard }) => (
|
|
75
|
+
<>
|
|
76
|
+
<WizardPage
|
|
77
|
+
label="Basic Settings"
|
|
78
|
+
wizard={wizard}
|
|
79
|
+
order={nextIdx()}
|
|
80
|
+
render={({ innerRef }) => <WizardManifestBasicSettings ref={innerRef} formik={formik} />}
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<WizardPage
|
|
84
|
+
label="Manifest"
|
|
85
|
+
wizard={wizard}
|
|
86
|
+
order={nextIdx()}
|
|
87
|
+
render={({ innerRef }) => <ManifestEntry ref={innerRef} formik={formik} app={application} />}
|
|
88
|
+
/>
|
|
89
|
+
</>
|
|
90
|
+
)}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { formatLabelSelectors, SelectorKind } from './ManifestCoordinates';
|
|
2
|
+
|
|
3
|
+
describe('<ManifestCoordinates />', () => {
|
|
4
|
+
it('handles ANY', () => {
|
|
5
|
+
const selectors = {
|
|
6
|
+
selectors: [
|
|
7
|
+
{
|
|
8
|
+
kind: SelectorKind.ANY,
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
expect(formatLabelSelectors(selectors)).toEqual('');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('handles EQUALS', () => {
|
|
16
|
+
const selectors = {
|
|
17
|
+
selectors: [
|
|
18
|
+
{
|
|
19
|
+
key: 'environment',
|
|
20
|
+
kind: SelectorKind.EQUALS,
|
|
21
|
+
values: ['prod'],
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
expect(formatLabelSelectors(selectors)).toEqual('environment = prod');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('handles NOT_EQUALS', () => {
|
|
29
|
+
const selectors = {
|
|
30
|
+
selectors: [
|
|
31
|
+
{
|
|
32
|
+
key: 'environment',
|
|
33
|
+
kind: SelectorKind.NOT_EQUALS,
|
|
34
|
+
values: ['prod'],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
expect(formatLabelSelectors(selectors)).toEqual('environment != prod');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('handles CONTAINS', () => {
|
|
42
|
+
const selectors = {
|
|
43
|
+
selectors: [
|
|
44
|
+
{
|
|
45
|
+
key: 'environment',
|
|
46
|
+
kind: SelectorKind.CONTAINS,
|
|
47
|
+
values: ['prod', 'staging'],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
expect(formatLabelSelectors(selectors)).toEqual('environment in (prod, staging)');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('handles NOT_CONTAINS', () => {
|
|
55
|
+
const selectors = {
|
|
56
|
+
selectors: [
|
|
57
|
+
{
|
|
58
|
+
key: 'environment',
|
|
59
|
+
kind: SelectorKind.NOT_CONTAINS,
|
|
60
|
+
values: ['prod', 'staging'],
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
expect(formatLabelSelectors(selectors)).toEqual('environment notin (prod, staging)');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('handles EXISTS', () => {
|
|
68
|
+
const selectors = {
|
|
69
|
+
selectors: [
|
|
70
|
+
{
|
|
71
|
+
key: 'environment',
|
|
72
|
+
kind: SelectorKind.EXISTS,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
expect(formatLabelSelectors(selectors)).toEqual('environment');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('handles NOT_EXISTS', () => {
|
|
80
|
+
const selectors = {
|
|
81
|
+
selectors: [
|
|
82
|
+
{
|
|
83
|
+
key: 'environment',
|
|
84
|
+
kind: SelectorKind.NOT_EXISTS,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
expect(formatLabelSelectors(selectors)).toEqual('!environment');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { flatten, get } from 'lodash';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { StageConstants } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
export interface IManifestCoordinateProps {
|
|
7
|
+
account: string;
|
|
8
|
+
manifestName: string;
|
|
9
|
+
location: string;
|
|
10
|
+
cluster: string;
|
|
11
|
+
criteria: string;
|
|
12
|
+
labelSelectors: ILabelSelectors;
|
|
13
|
+
manifestNamesByNamespace: IManifestNamesByNamespace;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface IManifestNamesByNamespace {
|
|
17
|
+
[namespace: string]: string[];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ILabelSelectors {
|
|
21
|
+
selectors: Array<{
|
|
22
|
+
key?: string;
|
|
23
|
+
kind: SelectorKind;
|
|
24
|
+
values?: string[];
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum SelectorKind {
|
|
29
|
+
ANY = 'ANY',
|
|
30
|
+
EQUALS = 'EQUALS',
|
|
31
|
+
NOT_EQUALS = 'NOT_EQUALS',
|
|
32
|
+
CONTAINS = 'CONTAINS',
|
|
33
|
+
NOT_CONTAINS = 'NOT_CONTAINS',
|
|
34
|
+
EXISTS = 'EXISTS',
|
|
35
|
+
NOT_EXISTS = 'NOT_EXISTS',
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const mapCriteriaToLabel = (criteria: string): string =>
|
|
39
|
+
get(
|
|
40
|
+
StageConstants.MANIFEST_CRITERIA_OPTIONS.find((option) => option.val === criteria),
|
|
41
|
+
'label',
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
export const formatLabelSelectors = (labelSelectors: ILabelSelectors): string => {
|
|
45
|
+
return (labelSelectors.selectors || [])
|
|
46
|
+
.map((selector) => {
|
|
47
|
+
const { key, kind, values = [] } = selector;
|
|
48
|
+
switch (kind) {
|
|
49
|
+
case SelectorKind.ANY:
|
|
50
|
+
return null;
|
|
51
|
+
case SelectorKind.EQUALS:
|
|
52
|
+
return `${key} = ${values[0]}`;
|
|
53
|
+
case SelectorKind.NOT_EQUALS:
|
|
54
|
+
return `${key} != ${values[0]}`;
|
|
55
|
+
case SelectorKind.CONTAINS:
|
|
56
|
+
return `${key} in (${values.join(', ')})`;
|
|
57
|
+
case SelectorKind.NOT_CONTAINS:
|
|
58
|
+
return `${key} notin (${values.join(', ')})`;
|
|
59
|
+
case SelectorKind.EXISTS:
|
|
60
|
+
return `${key}`;
|
|
61
|
+
case SelectorKind.NOT_EXISTS:
|
|
62
|
+
return `!${key}`;
|
|
63
|
+
default:
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
.filter((formatted) => !!formatted)
|
|
68
|
+
.join(', ');
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const formatManifestNames = (manifestName: string, manifestNamesByNamespace: IManifestNamesByNamespace) => {
|
|
72
|
+
if (manifestName) {
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
<dt>Manifest</dt>
|
|
76
|
+
<dd>{manifestName}</dd>
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
} else if (manifestNamesByNamespace) {
|
|
80
|
+
const names = flatten(Object.values(manifestNamesByNamespace));
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<dt>
|
|
84
|
+
Manifest
|
|
85
|
+
{names.length > 1 ? 's' : ''}
|
|
86
|
+
</dt>
|
|
87
|
+
<dd>{names.join(', ')}</dd>
|
|
88
|
+
</>
|
|
89
|
+
);
|
|
90
|
+
} else {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const ManifestCoordinates = ({
|
|
96
|
+
account,
|
|
97
|
+
manifestName,
|
|
98
|
+
location,
|
|
99
|
+
cluster,
|
|
100
|
+
criteria,
|
|
101
|
+
labelSelectors,
|
|
102
|
+
manifestNamesByNamespace,
|
|
103
|
+
}: IManifestCoordinateProps) => {
|
|
104
|
+
return (
|
|
105
|
+
<>
|
|
106
|
+
<dt>Account</dt>
|
|
107
|
+
<dd>{account}</dd>
|
|
108
|
+
{formatManifestNames(manifestName, manifestNamesByNamespace)}
|
|
109
|
+
<dt>Namespace</dt>
|
|
110
|
+
<dd>{location}</dd>
|
|
111
|
+
{mapCriteriaToLabel(criteria) != null && cluster != null && (
|
|
112
|
+
<>
|
|
113
|
+
<dt>Target</dt>
|
|
114
|
+
<dd>{`${mapCriteriaToLabel(criteria)} in cluster ${cluster}`}</dd>
|
|
115
|
+
</>
|
|
116
|
+
)}
|
|
117
|
+
{labelSelectors != null && !!formatLabelSelectors(labelSelectors) && (
|
|
118
|
+
<>
|
|
119
|
+
<dt>
|
|
120
|
+
Selector
|
|
121
|
+
{(labelSelectors.selectors || []).length > 1 ? 's' : ''}
|
|
122
|
+
</dt>
|
|
123
|
+
<dd>{formatLabelSelectors(labelSelectors)}</dd>
|
|
124
|
+
</>
|
|
125
|
+
)}
|
|
126
|
+
</>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { IExecutionDetailsSectionProps } from '@spinnaker/core';
|
|
4
|
+
import { ExecutionDetailsSection, StageFailureMessage } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
import type { ILabelSelectors, IManifestNamesByNamespace } from './ManifestCoordinates';
|
|
7
|
+
import { ManifestCoordinates } from './ManifestCoordinates';
|
|
8
|
+
|
|
9
|
+
interface IManifestExecutionDetailsProps extends IExecutionDetailsSectionProps {
|
|
10
|
+
context: {
|
|
11
|
+
account: string;
|
|
12
|
+
manifestName: string;
|
|
13
|
+
location: string;
|
|
14
|
+
cluster: string;
|
|
15
|
+
criteria: string;
|
|
16
|
+
labelSelectors: ILabelSelectors;
|
|
17
|
+
manifestNamesByNamespace: IManifestNamesByNamespace;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const manifestExecutionDetails = (stageName: string) => {
|
|
22
|
+
return class ManifestExecutionDetails extends React.Component<IManifestExecutionDetailsProps> {
|
|
23
|
+
public static title = stageName;
|
|
24
|
+
|
|
25
|
+
public render() {
|
|
26
|
+
const { stage, current, name } = this.props;
|
|
27
|
+
const {
|
|
28
|
+
account,
|
|
29
|
+
manifestName,
|
|
30
|
+
location,
|
|
31
|
+
cluster,
|
|
32
|
+
criteria,
|
|
33
|
+
labelSelectors,
|
|
34
|
+
manifestNamesByNamespace,
|
|
35
|
+
} = stage.context;
|
|
36
|
+
return (
|
|
37
|
+
<ExecutionDetailsSection name={name} current={current}>
|
|
38
|
+
<div className="row">
|
|
39
|
+
<div className="col-md-9">
|
|
40
|
+
<dl className="dl-narrow dl-horizontal">
|
|
41
|
+
<ManifestCoordinates
|
|
42
|
+
account={account}
|
|
43
|
+
manifestName={manifestName}
|
|
44
|
+
location={location}
|
|
45
|
+
cluster={cluster}
|
|
46
|
+
criteria={criteria}
|
|
47
|
+
labelSelectors={labelSelectors}
|
|
48
|
+
manifestNamesByNamespace={manifestNamesByNamespace}
|
|
49
|
+
/>
|
|
50
|
+
</dl>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<StageFailureMessage stage={stage} message={stage.failureMessage} />
|
|
54
|
+
</ExecutionDetailsSection>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|