@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,186 @@
|
|
|
1
|
+
import type { StateService } from '@uirouter/angularjs';
|
|
2
|
+
import type { IController, IQService, IScope } from 'angular';
|
|
3
|
+
import { module } from 'angular';
|
|
4
|
+
import type { IModalService } from 'angular-ui-bootstrap';
|
|
5
|
+
import { flattenDeep } from 'lodash';
|
|
6
|
+
|
|
7
|
+
import type { Application, ILoadBalancer, IManifest } from '@spinnaker/core';
|
|
8
|
+
import { InstanceReader, ManifestReader, RecentHistoryService, SETTINGS } from '@spinnaker/core';
|
|
9
|
+
|
|
10
|
+
import type { IKubernetesInstance } from '../../interfaces';
|
|
11
|
+
import { KubernetesManifestCommandBuilder } from '../../manifest/manifestCommandBuilder.service';
|
|
12
|
+
import { ManifestWizard } from '../../manifest/wizard/ManifestWizard';
|
|
13
|
+
|
|
14
|
+
interface InstanceFromStateParams {
|
|
15
|
+
instanceId: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface InstanceManager {
|
|
19
|
+
account: string;
|
|
20
|
+
region: string;
|
|
21
|
+
category: string; // e.g., serverGroup, loadBalancer.
|
|
22
|
+
name: string; // Parent resource name, not instance name.
|
|
23
|
+
instances: IKubernetesInstance[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface IConsoleOutputInstance {
|
|
27
|
+
account: string;
|
|
28
|
+
region: string;
|
|
29
|
+
id: string;
|
|
30
|
+
provider: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
interface InstanceIdentifier {
|
|
34
|
+
account: string;
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
namespace: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
class KubernetesInstanceDetailsController implements IController {
|
|
41
|
+
public state = { loading: true };
|
|
42
|
+
public instance: IKubernetesInstance;
|
|
43
|
+
public manifest: IManifest;
|
|
44
|
+
public consoleOutputInstance: IConsoleOutputInstance;
|
|
45
|
+
public environment: string;
|
|
46
|
+
|
|
47
|
+
public static $inject = ['instance', '$uibModal', '$q', '$scope', 'app', '$state'];
|
|
48
|
+
constructor(
|
|
49
|
+
instance: InstanceFromStateParams,
|
|
50
|
+
private $uibModal: IModalService,
|
|
51
|
+
private $q: IQService,
|
|
52
|
+
private $scope: IScope,
|
|
53
|
+
private app: Application,
|
|
54
|
+
private $state: StateService,
|
|
55
|
+
) {
|
|
56
|
+
this.app
|
|
57
|
+
.ready()
|
|
58
|
+
.then(() => {
|
|
59
|
+
this.extractInstance(instance);
|
|
60
|
+
this.app.onRefresh(this.$scope, () => this.extractInstance(instance));
|
|
61
|
+
this.$scope.isDisabled = !SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
62
|
+
})
|
|
63
|
+
.catch(() => this.autoClose());
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
public deleteInstance(): void {
|
|
67
|
+
this.$uibModal.open({
|
|
68
|
+
templateUrl: require('../../manifest/delete/delete.html'),
|
|
69
|
+
controller: 'kubernetesV2ManifestDeleteCtrl',
|
|
70
|
+
controllerAs: 'ctrl',
|
|
71
|
+
resolve: {
|
|
72
|
+
coordinates: {
|
|
73
|
+
name: this.instance.name,
|
|
74
|
+
namespace: this.instance.namespace,
|
|
75
|
+
account: this.instance.account,
|
|
76
|
+
},
|
|
77
|
+
application: this.app,
|
|
78
|
+
manifestController: (): string => null,
|
|
79
|
+
},
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public editInstance(): void {
|
|
84
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
85
|
+
this.app,
|
|
86
|
+
this.manifest.manifest,
|
|
87
|
+
this.instance.moniker,
|
|
88
|
+
this.instance.account,
|
|
89
|
+
).then((builtCommand) => {
|
|
90
|
+
ManifestWizard.show({ title: 'Edit Manifest', application: this.app, command: builtCommand });
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
private extractInstance(instanceFromState: InstanceFromStateParams): void {
|
|
95
|
+
const instanceId = this.retrieveInstance(instanceFromState);
|
|
96
|
+
if (!instanceId) {
|
|
97
|
+
return this.autoClose();
|
|
98
|
+
}
|
|
99
|
+
this.$q
|
|
100
|
+
.all([
|
|
101
|
+
this.fetchInstance(instanceId).then((instance: IKubernetesInstance) => {
|
|
102
|
+
this.instance = instance;
|
|
103
|
+
this.consoleOutputInstance = {
|
|
104
|
+
account: instance.account,
|
|
105
|
+
region: instance.zone,
|
|
106
|
+
id: instance.humanReadableName,
|
|
107
|
+
provider: instance.provider,
|
|
108
|
+
};
|
|
109
|
+
}),
|
|
110
|
+
ManifestReader.getManifest(instanceId.account, instanceId.namespace, instanceId.name).then(
|
|
111
|
+
(manifest: IManifest) => {
|
|
112
|
+
this.manifest = manifest;
|
|
113
|
+
},
|
|
114
|
+
),
|
|
115
|
+
])
|
|
116
|
+
.then(() => {
|
|
117
|
+
this.state.loading = false;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private fetchInstance(instance: InstanceIdentifier): PromiseLike<IKubernetesInstance> {
|
|
122
|
+
return InstanceReader.getInstanceDetails(instance.account, instance.namespace, instance.name).then(
|
|
123
|
+
(instanceDetails: IKubernetesInstance) => {
|
|
124
|
+
instanceDetails.id = instance.id;
|
|
125
|
+
instanceDetails.name = instance.name;
|
|
126
|
+
instanceDetails.provider = 'kubernetes';
|
|
127
|
+
return instanceDetails;
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private retrieveInstance(instanceFromState: InstanceFromStateParams): InstanceIdentifier {
|
|
133
|
+
const instanceLocatorPredicate = (dataSource: InstanceManager) => {
|
|
134
|
+
return dataSource.instances.some((possibleMatch) => possibleMatch.id === instanceFromState.instanceId);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const dataSources: InstanceManager[] = flattenDeep([
|
|
138
|
+
this.app.getDataSource('serverGroups').data,
|
|
139
|
+
this.app.getDataSource('loadBalancers').data,
|
|
140
|
+
this.app.getDataSource('loadBalancers').data.map((loadBalancer: ILoadBalancer) => loadBalancer.serverGroups),
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
const instanceManager = dataSources.find(instanceLocatorPredicate);
|
|
144
|
+
if (!instanceManager) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
const recentHistoryExtraData: { [key: string]: string } = {
|
|
148
|
+
region: instanceManager.region,
|
|
149
|
+
account: instanceManager.account,
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
if (instanceManager.category === 'serverGroup') {
|
|
153
|
+
recentHistoryExtraData.serverGroup = instanceManager.name;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const instance = instanceManager.instances.find((i) => i.id === instanceFromState.instanceId);
|
|
157
|
+
if (!instance) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
RecentHistoryService.addExtraDataToLatest('instances', recentHistoryExtraData);
|
|
162
|
+
|
|
163
|
+
return {
|
|
164
|
+
id: instance.id,
|
|
165
|
+
name: instance.name,
|
|
166
|
+
namespace: instanceManager.region,
|
|
167
|
+
account: instanceManager.account,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
private autoClose(): void {
|
|
172
|
+
if (this.$scope.$$destroyed) {
|
|
173
|
+
return;
|
|
174
|
+
} else {
|
|
175
|
+
this.$state.params.allowModalToStayOpen = true;
|
|
176
|
+
this.$state.go('^', null, { location: 'replace' });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export const KUBERNETES_INSTANCE_DETAILS_CTRL = 'spinnaker.kubernetes.instanceDetails.controller';
|
|
182
|
+
|
|
183
|
+
module(KUBERNETES_INSTANCE_DETAILS_CTRL, []).controller(
|
|
184
|
+
'kubernetesV2InstanceDetailsCtrl',
|
|
185
|
+
KubernetesInstanceDetailsController,
|
|
186
|
+
);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<div class="details-panel">
|
|
2
|
+
<div class="header">
|
|
3
|
+
<instance-details-header
|
|
4
|
+
cloud-provider="ctrl.instance.cloudProvider"
|
|
5
|
+
health-state="instance.healthState"
|
|
6
|
+
instance-id="ctrl.instance.displayName"
|
|
7
|
+
loading="ctrl.state.loading"
|
|
8
|
+
standalone="false"
|
|
9
|
+
></instance-details-header>
|
|
10
|
+
<div class="actions" ng-if="!ctrl.state.loading">
|
|
11
|
+
<div class="dropdown" uib-dropdown dropdown-append-to-body>
|
|
12
|
+
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle ng-hide="isDisabled">
|
|
13
|
+
{{ctrl.instance.kind | robotToHuman}} Actions <span class="caret"></span>
|
|
14
|
+
</button>
|
|
15
|
+
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
16
|
+
<li>
|
|
17
|
+
<a href ng-click="ctrl.deleteInstance()">Delete</a>
|
|
18
|
+
</li>
|
|
19
|
+
<li>
|
|
20
|
+
<a href ng-click="ctrl.editInstance()">Edit</a>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div ng-if="!ctrl.state.loading" class="content">
|
|
28
|
+
<collapsible-section heading="Information" expanded="true">
|
|
29
|
+
<dl class="dl-horizontal dl-narrow">
|
|
30
|
+
<dt>Created</dt>
|
|
31
|
+
<dd>{{ctrl.instance.createdTime | timestamp}}</dd>
|
|
32
|
+
<dt>Account</dt>
|
|
33
|
+
<dd><account-tag account="ctrl.instance.account" pad="right"></account-tag></dd>
|
|
34
|
+
<dt>Namespace</dt>
|
|
35
|
+
<dd>{{ctrl.instance.namespace}}</dd>
|
|
36
|
+
<dt>Kind</dt>
|
|
37
|
+
<dd>{{ctrl.instance.kind}}</dd>
|
|
38
|
+
<dt>QOS Class</dt>
|
|
39
|
+
<dd><kubernetes-manifest-qos manifest="ctrl.manifest.manifest"></kubernetes-manifest-qos></dd>
|
|
40
|
+
<dt>Logs</dt>
|
|
41
|
+
<dd>
|
|
42
|
+
<console-output-link instance="ctrl.consoleOutputInstance" uses-multi-output="true"></console-output-link>
|
|
43
|
+
</dd>
|
|
44
|
+
</dl>
|
|
45
|
+
</collapsible-section>
|
|
46
|
+
<collapsible-section heading="Status" expanded="true">
|
|
47
|
+
<ul ng-repeat="condition in ctrl.manifest.manifest.status.conditions">
|
|
48
|
+
<kubernetes-manifest-condition condition="condition"></kubernetes-manifest-condition>
|
|
49
|
+
</ul>
|
|
50
|
+
</collapsible-section>
|
|
51
|
+
|
|
52
|
+
<kubernetes-annotation-custom-sections
|
|
53
|
+
manifest="ctrl.manifest.manifest"
|
|
54
|
+
resource="ctrl.instance"
|
|
55
|
+
></kubernetes-annotation-custom-sections>
|
|
56
|
+
|
|
57
|
+
<collapsible-section heading="Events" expanded="true">
|
|
58
|
+
<kubernetes-manifest-events manifest="ctrl.manifest"></kubernetes-manifest-events>
|
|
59
|
+
</collapsible-section>
|
|
60
|
+
|
|
61
|
+
<collapsible-section heading="Resources" expanded="true">
|
|
62
|
+
<kubernetes-manifest-resources
|
|
63
|
+
manifest="ctrl.manifest.manifest"
|
|
64
|
+
metrics="ctrl.manifest.metrics"
|
|
65
|
+
></kubernetes-manifest-resources>
|
|
66
|
+
</collapsible-section>
|
|
67
|
+
|
|
68
|
+
<collapsible-section heading="Labels" expanded="true">
|
|
69
|
+
<kubernetes-manifest-labels manifest="ctrl.manifest.manifest"></kubernetes-manifest-labels>
|
|
70
|
+
</collapsible-section>
|
|
71
|
+
|
|
72
|
+
<instance-links
|
|
73
|
+
address="ctrl.instance.publicDnsName"
|
|
74
|
+
application="ctrl.app"
|
|
75
|
+
instance="ctrl.instance"
|
|
76
|
+
moniker="ctrl.instance.moniker"
|
|
77
|
+
environment="ctrl.environment"
|
|
78
|
+
></instance-links>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './details/details.controller';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './infrastructure.types';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IInstance,
|
|
3
|
+
ILoadBalancer,
|
|
4
|
+
IMoniker,
|
|
5
|
+
ISecurityGroupDetail,
|
|
6
|
+
IServerGroup,
|
|
7
|
+
IServerGroupManager,
|
|
8
|
+
} from '@spinnaker/core';
|
|
9
|
+
|
|
10
|
+
export interface IKubernetesResource {
|
|
11
|
+
apiVersion: string;
|
|
12
|
+
createdTime?: number;
|
|
13
|
+
displayName: string;
|
|
14
|
+
kind: string;
|
|
15
|
+
namespace: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IKubernetesInstance extends IInstance, IKubernetesResource {
|
|
19
|
+
humanReadableName: string;
|
|
20
|
+
moniker: IMoniker;
|
|
21
|
+
publicDnsName?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface IKubernetesLoadBalancer extends ILoadBalancer, IKubernetesResource {}
|
|
25
|
+
|
|
26
|
+
export interface IKubernetesSecurityGroup extends ISecurityGroupDetail, IKubernetesResource {
|
|
27
|
+
account: string;
|
|
28
|
+
moniker: IMoniker;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface IKubernetesServerGroup extends IServerGroup, IKubernetesResource {
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface IKubernetesServerGroupManager extends IServerGroupManager, IKubernetesResource {}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
CloudProviderRegistry,
|
|
5
|
+
SETTINGS,
|
|
6
|
+
STAGE_ARTIFACT_SELECTOR_COMPONENT_REACT,
|
|
7
|
+
YAML_EDITOR_COMPONENT,
|
|
8
|
+
} from '@spinnaker/core';
|
|
9
|
+
|
|
10
|
+
import './help/kubernetes.help';
|
|
11
|
+
import { KUBERNETES_INSTANCE_DETAILS_CTRL } from './instance/details/details.controller';
|
|
12
|
+
import { KUBERNETES_LOAD_BALANCER_DETAILS_CTRL } from './loadBalancer/details/details.controller';
|
|
13
|
+
import { KUBERNETES_LOAD_BALANCER_TRANSFORMER } from './loadBalancer/transformer';
|
|
14
|
+
import kubernetesLogo from './logo/kubernetes.logo.svg';
|
|
15
|
+
import { KUBERNETES_ANNOTATION_CUSTOM_SECTIONS } from './manifest/annotationCustomSections.component';
|
|
16
|
+
import { KUBERNETES_MANIFEST_ARTIFACT } from './manifest/artifact/artifact.component';
|
|
17
|
+
import { KUBERNETES_MANIFEST_DELETE_CTRL } from './manifest/delete/delete.controller';
|
|
18
|
+
import { JSON_EDITOR_COMPONENT } from './manifest/editor/json/jsonEditor.component';
|
|
19
|
+
import { KUBERNETES_MANIFEST_EVENTS } from './manifest/manifestEvents.component';
|
|
20
|
+
import { KUBERNETES_MANIFEST_IMAGE_DETAILS } from './manifest/manifestImageDetails.component';
|
|
21
|
+
import { KUBERNETES_MANIFEST_LABELS } from './manifest/manifestLabels.component';
|
|
22
|
+
import { KUBERNETES_MANIFEST_QOS } from './manifest/manifestQos.component';
|
|
23
|
+
import { KUBERNETES_MANIFEST_RESOURCES } from './manifest/manifestResources.component';
|
|
24
|
+
import { KUBERNETES_ROLLING_RESTART } from './manifest/rollout/RollingRestart';
|
|
25
|
+
import { KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL } from './manifest/rollout/pause.controller';
|
|
26
|
+
import { KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL } from './manifest/rollout/resume.controller';
|
|
27
|
+
import { KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL } from './manifest/rollout/undo.controller';
|
|
28
|
+
import { KUBERNETES_MANIFEST_SCALE_CTRL } from './manifest/scale/scale.controller';
|
|
29
|
+
import { KUBERNETES_MANIFEST_SELECTOR } from './manifest/selector/selector.component';
|
|
30
|
+
import { KUBERNETES_MANIFEST_CONDITION } from './manifest/status/condition.component';
|
|
31
|
+
import { KUBERNETES_MANIFEST_STATUS } from './manifest/status/status.component';
|
|
32
|
+
import { ManifestWizard } from './manifest/wizard/ManifestWizard';
|
|
33
|
+
import './pipelines/stages';
|
|
34
|
+
import { KUBERNETES_DISABLE_MANIFEST_STAGE } from './pipelines/stages/traffic/disableManifest.stage';
|
|
35
|
+
import { KUBERNETES_ENABLE_MANIFEST_STAGE } from './pipelines/stages/traffic/enableManifest.stage';
|
|
36
|
+
import './pipelines/validation/manifestSelector.validator';
|
|
37
|
+
import { KUBERNETS_RAW_RESOURCE_MODULE } from './rawResource';
|
|
38
|
+
import { KUBERNETES_RESOURCE_STATES } from './resources/resources.state';
|
|
39
|
+
import { KUBERNETES_SECURITY_GROUP_DETAILS_CTRL } from './securityGroup/details/details.controller';
|
|
40
|
+
import { KubernetesSecurityGroupReader } from './securityGroup/securityGroup.reader';
|
|
41
|
+
import { KUBERNETES_SECURITY_GROUP_TRANSFORMER } from './securityGroup/transformer';
|
|
42
|
+
import { KUBERNETES_SERVER_GROUP_DETAILS_CTRL } from './serverGroup/details/details.controller';
|
|
43
|
+
import { KUBERNETES_SERVER_GROUP_RESIZE_CTRL } from './serverGroup/details/resize/resize.controller';
|
|
44
|
+
import { KUBERNETES_SERVER_GROUP_COMMAND_BUILDER } from './serverGroup/serverGroupCommandBuilder.service';
|
|
45
|
+
import { KUBERNETES_SERVER_GROUP_TRANSFORMER } from './serverGroup/serverGroupTransformer.service';
|
|
46
|
+
import { KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL } from './serverGroupManager/details/details.controller';
|
|
47
|
+
import './validation/applicationName.validator';
|
|
48
|
+
|
|
49
|
+
import './logo/kubernetes.logo.less';
|
|
50
|
+
|
|
51
|
+
export const KUBERNETES_MODULE = 'spinnaker.kubernetes';
|
|
52
|
+
|
|
53
|
+
const requires = [
|
|
54
|
+
KUBERNETES_INSTANCE_DETAILS_CTRL,
|
|
55
|
+
KUBERNETES_LOAD_BALANCER_DETAILS_CTRL,
|
|
56
|
+
KUBERNETES_SECURITY_GROUP_DETAILS_CTRL,
|
|
57
|
+
KUBERNETES_SERVER_GROUP_COMMAND_BUILDER,
|
|
58
|
+
KUBERNETES_SERVER_GROUP_DETAILS_CTRL,
|
|
59
|
+
KUBERNETES_SERVER_GROUP_TRANSFORMER,
|
|
60
|
+
KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL,
|
|
61
|
+
KUBERNETES_SERVER_GROUP_RESIZE_CTRL,
|
|
62
|
+
KUBERNETES_SERVER_GROUP_MANAGER_DETAILS_CTRL,
|
|
63
|
+
KUBERNETES_MANIFEST_DELETE_CTRL,
|
|
64
|
+
KUBERNETES_MANIFEST_SCALE_CTRL,
|
|
65
|
+
KUBERNETES_MANIFEST_UNDO_ROLLOUT_CTRL,
|
|
66
|
+
KUBERNETES_MANIFEST_PAUSE_ROLLOUT_CTRL,
|
|
67
|
+
KUBERNETES_MANIFEST_RESUME_ROLLOUT_CTRL,
|
|
68
|
+
KUBERNETES_MANIFEST_STATUS,
|
|
69
|
+
KUBERNETES_MANIFEST_CONDITION,
|
|
70
|
+
KUBERNETES_MANIFEST_ARTIFACT,
|
|
71
|
+
KUBERNETES_LOAD_BALANCER_TRANSFORMER,
|
|
72
|
+
KUBERNETES_SECURITY_GROUP_TRANSFORMER,
|
|
73
|
+
KUBERNETES_MANIFEST_SELECTOR,
|
|
74
|
+
KUBERNETES_MANIFEST_LABELS,
|
|
75
|
+
KUBERNETES_MANIFEST_EVENTS,
|
|
76
|
+
KUBERNETES_MANIFEST_RESOURCES,
|
|
77
|
+
KUBERNETES_MANIFEST_QOS,
|
|
78
|
+
KUBERNETES_ANNOTATION_CUSTOM_SECTIONS,
|
|
79
|
+
KUBERNETES_MANIFEST_IMAGE_DETAILS,
|
|
80
|
+
KUBERNETES_RESOURCE_STATES,
|
|
81
|
+
YAML_EDITOR_COMPONENT,
|
|
82
|
+
JSON_EDITOR_COMPONENT,
|
|
83
|
+
KUBERNETES_ENABLE_MANIFEST_STAGE,
|
|
84
|
+
KUBERNETES_DISABLE_MANIFEST_STAGE,
|
|
85
|
+
STAGE_ARTIFACT_SELECTOR_COMPONENT_REACT,
|
|
86
|
+
KUBERNETES_ROLLING_RESTART,
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
if (SETTINGS.feature.kubernetesRawResources) {
|
|
90
|
+
requires.push(KUBERNETS_RAW_RESOURCE_MODULE);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
module(KUBERNETES_MODULE, requires).config(() => {
|
|
94
|
+
CloudProviderRegistry.registerProvider('kubernetes', {
|
|
95
|
+
name: 'Kubernetes',
|
|
96
|
+
adHocInfrastructureWritesEnabled: SETTINGS.kubernetesAdHocInfraWritesEnabled,
|
|
97
|
+
logo: {
|
|
98
|
+
path: kubernetesLogo,
|
|
99
|
+
},
|
|
100
|
+
serverGroup: {
|
|
101
|
+
CloneServerGroupModal: ManifestWizard,
|
|
102
|
+
commandBuilder: 'kubernetesV2ServerGroupCommandBuilder',
|
|
103
|
+
detailsController: 'kubernetesV2ServerGroupDetailsCtrl',
|
|
104
|
+
detailsTemplateUrl: require('./serverGroup/details/details.html'),
|
|
105
|
+
transformer: 'kubernetesV2ServerGroupTransformer',
|
|
106
|
+
},
|
|
107
|
+
serverGroupManager: {
|
|
108
|
+
detailsTemplateUrl: require('./serverGroupManager/details/details.html'),
|
|
109
|
+
detailsController: 'kubernetesV2ServerGroupManagerDetailsCtrl',
|
|
110
|
+
},
|
|
111
|
+
loadBalancer: {
|
|
112
|
+
CreateLoadBalancerModal: ManifestWizard,
|
|
113
|
+
detailsController: 'kubernetesV2LoadBalancerDetailsCtrl',
|
|
114
|
+
detailsTemplateUrl: require('./loadBalancer/details/details.html'),
|
|
115
|
+
transformer: 'kubernetesV2LoadBalancerTransformer',
|
|
116
|
+
},
|
|
117
|
+
securityGroup: {
|
|
118
|
+
reader: KubernetesSecurityGroupReader,
|
|
119
|
+
CreateSecurityGroupModal: ManifestWizard,
|
|
120
|
+
detailsController: 'kubernetesV2SecurityGroupDetailsCtrl',
|
|
121
|
+
detailsTemplateUrl: require('./securityGroup/details/details.html'),
|
|
122
|
+
transformer: 'kubernetesV2SecurityGroupTransformer',
|
|
123
|
+
},
|
|
124
|
+
instance: {
|
|
125
|
+
detailsController: 'kubernetesV2InstanceDetailsCtrl',
|
|
126
|
+
detailsTemplateUrl: require('./instance/details/details.html'),
|
|
127
|
+
},
|
|
128
|
+
unsupportedStageTypes: [
|
|
129
|
+
'deploy',
|
|
130
|
+
'destroyServerGroup',
|
|
131
|
+
'disableCluster',
|
|
132
|
+
'disableServerGroup',
|
|
133
|
+
'enableServerGroup',
|
|
134
|
+
'findImage',
|
|
135
|
+
'resizeServerGroup',
|
|
136
|
+
'rollbackCluster',
|
|
137
|
+
'runJob',
|
|
138
|
+
'scaleDown',
|
|
139
|
+
'scaleDownCluster',
|
|
140
|
+
'shrinkCluster',
|
|
141
|
+
'upsertLoadBalancers',
|
|
142
|
+
],
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { StateService } from '@uirouter/angularjs';
|
|
2
|
+
import type { IController, IScope } from 'angular';
|
|
3
|
+
import { module } from 'angular';
|
|
4
|
+
import type { IModalService } from 'angular-ui-bootstrap';
|
|
5
|
+
|
|
6
|
+
import type { Application, ILoadBalancer, IManifest } from '@spinnaker/core';
|
|
7
|
+
import { ManifestReader, SETTINGS } from '@spinnaker/core';
|
|
8
|
+
|
|
9
|
+
import type { IKubernetesLoadBalancer } from '../../interfaces';
|
|
10
|
+
import { KubernetesManifestCommandBuilder } from '../../manifest/manifestCommandBuilder.service';
|
|
11
|
+
import { ManifestWizard } from '../../manifest/wizard/ManifestWizard';
|
|
12
|
+
|
|
13
|
+
interface ILoadBalancerFromStateParams {
|
|
14
|
+
accountId: string;
|
|
15
|
+
region: string;
|
|
16
|
+
name: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
class KubernetesLoadBalancerDetailsController implements IController {
|
|
20
|
+
public state = { loading: true };
|
|
21
|
+
public manifest: IManifest;
|
|
22
|
+
public loadBalancer: IKubernetesLoadBalancer;
|
|
23
|
+
|
|
24
|
+
public static $inject = ['$uibModal', '$state', '$scope', 'loadBalancer', 'app'];
|
|
25
|
+
constructor(
|
|
26
|
+
private $uibModal: IModalService,
|
|
27
|
+
private $state: StateService,
|
|
28
|
+
private $scope: IScope,
|
|
29
|
+
loadBalancer: ILoadBalancerFromStateParams,
|
|
30
|
+
private app: Application,
|
|
31
|
+
) {
|
|
32
|
+
const dataSource = this.app.getDataSource('loadBalancers');
|
|
33
|
+
dataSource
|
|
34
|
+
.ready()
|
|
35
|
+
.then(() => {
|
|
36
|
+
this.extractLoadBalancer(loadBalancer);
|
|
37
|
+
this.$scope.isDisabled = !SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
38
|
+
dataSource.onRefresh(this.$scope, () => this.extractLoadBalancer(loadBalancer));
|
|
39
|
+
})
|
|
40
|
+
.catch(() => this.autoClose());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public deleteLoadBalancer(): void {
|
|
44
|
+
this.$uibModal.open({
|
|
45
|
+
templateUrl: require('../../manifest/delete/delete.html'),
|
|
46
|
+
controller: 'kubernetesV2ManifestDeleteCtrl',
|
|
47
|
+
controllerAs: 'ctrl',
|
|
48
|
+
resolve: {
|
|
49
|
+
coordinates: {
|
|
50
|
+
name: this.loadBalancer.name,
|
|
51
|
+
namespace: this.loadBalancer.namespace,
|
|
52
|
+
account: this.loadBalancer.account,
|
|
53
|
+
},
|
|
54
|
+
application: this.app,
|
|
55
|
+
manifestController: (): string => null,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public editLoadBalancer(): void {
|
|
61
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
62
|
+
this.app,
|
|
63
|
+
this.manifest.manifest,
|
|
64
|
+
this.loadBalancer.moniker,
|
|
65
|
+
this.loadBalancer.account,
|
|
66
|
+
).then((builtCommand) => {
|
|
67
|
+
ManifestWizard.show({ title: 'Edit Manifest', application: this.app, command: builtCommand });
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private extractLoadBalancer({ accountId, name, region }: ILoadBalancerFromStateParams): void {
|
|
72
|
+
const loadBalancer = this.app.getDataSource('loadBalancers').data.find((test: ILoadBalancer) => {
|
|
73
|
+
return test.name === name && test.account === accountId && test.region === region;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
if (!loadBalancer) {
|
|
77
|
+
return this.autoClose();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ManifestReader.getManifest(accountId, region, name).then((manifest: IManifest) => {
|
|
81
|
+
this.manifest = manifest;
|
|
82
|
+
this.loadBalancer = loadBalancer;
|
|
83
|
+
this.state.loading = false;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private autoClose(): void {
|
|
88
|
+
if (this.$scope.$$destroyed) {
|
|
89
|
+
return;
|
|
90
|
+
} else {
|
|
91
|
+
this.$state.params.allowModalToStayOpen = true;
|
|
92
|
+
this.$state.go('^', null, { location: 'replace' });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const KUBERNETES_LOAD_BALANCER_DETAILS_CTRL = 'spinnaker.kubernetes.loadBalancerDetails.controller';
|
|
98
|
+
module(KUBERNETES_LOAD_BALANCER_DETAILS_CTRL, []).controller(
|
|
99
|
+
'kubernetesV2LoadBalancerDetailsCtrl',
|
|
100
|
+
KubernetesLoadBalancerDetailsController,
|
|
101
|
+
);
|