@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,207 @@
|
|
|
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
|
+
|
|
6
|
+
import type { Application, IManifest, IOwnerOption, IServerGroup } from '@spinnaker/core';
|
|
7
|
+
import {
|
|
8
|
+
ClusterTargetBuilder,
|
|
9
|
+
ConfirmationModalService,
|
|
10
|
+
ManifestReader,
|
|
11
|
+
SERVER_GROUP_WRITER,
|
|
12
|
+
ServerGroupReader,
|
|
13
|
+
SETTINGS,
|
|
14
|
+
} from '@spinnaker/core';
|
|
15
|
+
|
|
16
|
+
import type { IKubernetesServerGroup } from '../../interfaces';
|
|
17
|
+
import { KubernetesManifestCommandBuilder } from '../../manifest/manifestCommandBuilder.service';
|
|
18
|
+
import { ManifestTrafficService } from '../../manifest/traffic/ManifestTrafficService';
|
|
19
|
+
import { ManifestWizard } from '../../manifest/wizard/ManifestWizard';
|
|
20
|
+
|
|
21
|
+
interface IServerGroupFromStateParams {
|
|
22
|
+
accountId: string;
|
|
23
|
+
region: string;
|
|
24
|
+
name: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class KubernetesServerGroupDetailsController implements IController {
|
|
28
|
+
public state = { loading: true };
|
|
29
|
+
public serverGroup: IKubernetesServerGroup;
|
|
30
|
+
public manifest: IManifest;
|
|
31
|
+
public entityTagTargets: IOwnerOption[];
|
|
32
|
+
|
|
33
|
+
public static $inject = ['serverGroup', 'app', '$uibModal', '$scope', '$state', '$q'];
|
|
34
|
+
constructor(
|
|
35
|
+
serverGroup: IServerGroupFromStateParams,
|
|
36
|
+
public app: Application,
|
|
37
|
+
private $uibModal: IModalService,
|
|
38
|
+
private $scope: IScope,
|
|
39
|
+
private $state: StateService,
|
|
40
|
+
private $q: IQService,
|
|
41
|
+
) {
|
|
42
|
+
const dataSource = this.app.getDataSource('serverGroups');
|
|
43
|
+
dataSource
|
|
44
|
+
.ready()
|
|
45
|
+
.then(() => {
|
|
46
|
+
this.extractServerGroup(serverGroup);
|
|
47
|
+
this.$scope.isDisabled = !SETTINGS.kubernetesAdHocInfraWritesEnabled;
|
|
48
|
+
dataSource.onRefresh(this.$scope, () => this.extractServerGroup(serverGroup));
|
|
49
|
+
})
|
|
50
|
+
.catch(() => this.autoClose());
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private ownerReferences(): any[] {
|
|
54
|
+
const manifest = this.manifest.manifest;
|
|
55
|
+
if (
|
|
56
|
+
manifest != null &&
|
|
57
|
+
manifest.hasOwnProperty('metadata') &&
|
|
58
|
+
manifest.metadata.hasOwnProperty('ownerReferences') &&
|
|
59
|
+
Array.isArray(manifest.metadata.ownerReferences)
|
|
60
|
+
) {
|
|
61
|
+
return manifest.metadata.ownerReferences;
|
|
62
|
+
} else {
|
|
63
|
+
return [] as any[];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
private ownerIsController(ownerReference: any): boolean {
|
|
68
|
+
return ownerReference.hasOwnProperty('controller') && ownerReference.controller === true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private lowerCaseFirstLetter(s: string): string {
|
|
72
|
+
return s.charAt(0).toLowerCase() + s.slice(1);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public manifestController(): string {
|
|
76
|
+
const controller = this.ownerReferences().find(this.ownerIsController);
|
|
77
|
+
if (typeof controller === 'undefined') {
|
|
78
|
+
return null;
|
|
79
|
+
} else {
|
|
80
|
+
return this.lowerCaseFirstLetter(controller.kind) + ' ' + controller.name;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public canScaleServerGroup(): boolean {
|
|
85
|
+
return this.serverGroup.kind !== 'DaemonSet' && this.manifestController() === null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public scaleServerGroup(): void {
|
|
89
|
+
this.$uibModal.open({
|
|
90
|
+
templateUrl: require('../../manifest/scale/scale.html'),
|
|
91
|
+
controller: 'kubernetesV2ManifestScaleCtrl',
|
|
92
|
+
controllerAs: 'ctrl',
|
|
93
|
+
resolve: {
|
|
94
|
+
coordinates: {
|
|
95
|
+
name: this.serverGroup.name,
|
|
96
|
+
namespace: this.serverGroup.namespace,
|
|
97
|
+
account: this.serverGroup.account,
|
|
98
|
+
},
|
|
99
|
+
currentReplicas: this.manifest.manifest.spec.replicas,
|
|
100
|
+
application: this.app,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public canEditServerGroup(): boolean {
|
|
106
|
+
return this.manifestController() === null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public editServerGroup(): void {
|
|
110
|
+
KubernetesManifestCommandBuilder.buildNewManifestCommand(
|
|
111
|
+
this.app,
|
|
112
|
+
this.manifest.manifest,
|
|
113
|
+
this.serverGroup.moniker,
|
|
114
|
+
this.serverGroup.account,
|
|
115
|
+
).then((builtCommand) => {
|
|
116
|
+
ManifestWizard.show({ title: 'Edit Manifest', application: this.app, command: builtCommand });
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
public deleteServerGroup(): void {
|
|
121
|
+
this.$uibModal.open({
|
|
122
|
+
templateUrl: require('../../manifest/delete/delete.html'),
|
|
123
|
+
controller: 'kubernetesV2ManifestDeleteCtrl',
|
|
124
|
+
controllerAs: 'ctrl',
|
|
125
|
+
resolve: {
|
|
126
|
+
coordinates: {
|
|
127
|
+
name: this.serverGroup.name,
|
|
128
|
+
namespace: this.serverGroup.namespace,
|
|
129
|
+
account: this.serverGroup.account,
|
|
130
|
+
},
|
|
131
|
+
manifestController: () => this.manifestController(),
|
|
132
|
+
application: this.app,
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
public canDisable = () => ManifestTrafficService.canDisableServerGroup(this.serverGroup);
|
|
138
|
+
|
|
139
|
+
public disableServerGroup = (): void => {
|
|
140
|
+
ConfirmationModalService.confirm({
|
|
141
|
+
header: `Really disable ${this.manifest.name}?`,
|
|
142
|
+
buttonText: 'Disable',
|
|
143
|
+
askForReason: true,
|
|
144
|
+
submitJustWithReason: true,
|
|
145
|
+
submitMethod: ({ reason }: { reason: string }) => ManifestTrafficService.disable(this.manifest, this.app, reason),
|
|
146
|
+
taskMonitorConfig: {
|
|
147
|
+
application: this.app,
|
|
148
|
+
title: `Disabling ${this.manifest.name}`,
|
|
149
|
+
onTaskComplete: () => this.app.getDataSource('serverGroups').refresh(),
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
public canEnable = () => ManifestTrafficService.canEnableServerGroup(this.serverGroup);
|
|
155
|
+
|
|
156
|
+
public enableServerGroup = (): void => {
|
|
157
|
+
ConfirmationModalService.confirm({
|
|
158
|
+
header: `Really enable ${this.manifest.name}?`,
|
|
159
|
+
buttonText: 'Enable',
|
|
160
|
+
askForReason: true,
|
|
161
|
+
submitJustWithReason: true,
|
|
162
|
+
submitMethod: ({ reason }: { reason: string }) => ManifestTrafficService.enable(this.manifest, this.app, reason),
|
|
163
|
+
taskMonitorConfig: {
|
|
164
|
+
application: this.app,
|
|
165
|
+
title: `Enabling ${this.manifest.name}`,
|
|
166
|
+
onTaskComplete: () => this.app.getDataSource('serverGroups').refresh(),
|
|
167
|
+
},
|
|
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
|
+
private extractServerGroup({ accountId, name, region }: IServerGroupFromStateParams): void {
|
|
181
|
+
this.$q
|
|
182
|
+
.all([
|
|
183
|
+
ServerGroupReader.getServerGroup(this.app.name, accountId, region, name),
|
|
184
|
+
ManifestReader.getManifest(accountId, region, name),
|
|
185
|
+
])
|
|
186
|
+
.then(([serverGroupDetails, manifest]: [IServerGroup, IManifest]) => {
|
|
187
|
+
if (!serverGroupDetails) {
|
|
188
|
+
return this.autoClose();
|
|
189
|
+
}
|
|
190
|
+
this.serverGroup = serverGroupDetails as IKubernetesServerGroup;
|
|
191
|
+
this.entityTagTargets = this.configureEntityTagTargets();
|
|
192
|
+
this.manifest = manifest;
|
|
193
|
+
this.state.loading = false;
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
private configureEntityTagTargets(): IOwnerOption[] {
|
|
198
|
+
return ClusterTargetBuilder.buildClusterTargets(this.serverGroup);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export const KUBERNETES_SERVER_GROUP_DETAILS_CTRL = 'spinnaker.kubernetes.serverGroup.details.controller';
|
|
203
|
+
|
|
204
|
+
module(KUBERNETES_SERVER_GROUP_DETAILS_CTRL, [SERVER_GROUP_WRITER]).controller(
|
|
205
|
+
'kubernetesV2ServerGroupDetailsCtrl',
|
|
206
|
+
KubernetesServerGroupDetailsController,
|
|
207
|
+
);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<div class="details-panel" ng-class="{disabled: ctrl.serverGroup.isDisabled || ctrl.serverGroup.disabled}">
|
|
2
|
+
<div class="header" ng-if="ctrl.state.loading">
|
|
3
|
+
<div class="close-button">
|
|
4
|
+
<a class="btn btn-link" ui-sref="^">
|
|
5
|
+
<span class="glyphicon glyphicon-remove"></span>
|
|
6
|
+
</a>
|
|
7
|
+
</div>
|
|
8
|
+
<h4 class="text-center">
|
|
9
|
+
<span us-spinner="{radius:20, width:6, length: 12}"></span>
|
|
10
|
+
</h4>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="header" ng-if="!ctrl.state.loading">
|
|
14
|
+
<div class="close-button">
|
|
15
|
+
<a class="btn btn-link" ui-sref="^">
|
|
16
|
+
<span class="glyphicon glyphicon-remove"></span>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="header-text horizontal middle">
|
|
20
|
+
<cloud-provider-logo
|
|
21
|
+
provider="ctrl.serverGroup.cloudProvider"
|
|
22
|
+
height="'36px'"
|
|
23
|
+
width="'36px'"
|
|
24
|
+
></cloud-provider-logo>
|
|
25
|
+
<h3 class="horizontal middle space-between flex-1" select-on-dbl-click>
|
|
26
|
+
{{ctrl.serverGroup.displayName}}
|
|
27
|
+
<render-if-feature feature="entityTags">
|
|
28
|
+
<entity-notifications
|
|
29
|
+
entity="ctrl.serverGroup"
|
|
30
|
+
application="ctrl.app"
|
|
31
|
+
placement="bottom"
|
|
32
|
+
h-offset-percent="90%"
|
|
33
|
+
entity-type="serverGroup"
|
|
34
|
+
page-location="details"
|
|
35
|
+
on-update="ctrl.app.serverGroups.refresh()"
|
|
36
|
+
></entity-notifications>
|
|
37
|
+
</render-if-feature>
|
|
38
|
+
</h3>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="actions">
|
|
41
|
+
<div class="dropdown" uib-dropdown dropdown-append-to-body>
|
|
42
|
+
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle ng-hide="isDisabled">
|
|
43
|
+
{{ctrl.serverGroup.kind | robotToHuman}} Actions <span class="caret"></span>
|
|
44
|
+
</button>
|
|
45
|
+
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
46
|
+
<li ng-if="ctrl.canEditServerGroup()">
|
|
47
|
+
<a href ng-click="ctrl.editServerGroup()"> Edit </a>
|
|
48
|
+
</li>
|
|
49
|
+
<li ng-if="ctrl.canScaleServerGroup()">
|
|
50
|
+
<a href ng-click="ctrl.scaleServerGroup()"> Scale </a>
|
|
51
|
+
</li>
|
|
52
|
+
<li ng-if="ctrl.canEnable()">
|
|
53
|
+
<a href ng-click="ctrl.enableServerGroup()"> Enable </a>
|
|
54
|
+
</li>
|
|
55
|
+
<li ng-if="ctrl.canDisable()">
|
|
56
|
+
<a href ng-click="ctrl.disableServerGroup()"> Disable </a>
|
|
57
|
+
</li>
|
|
58
|
+
<li>
|
|
59
|
+
<a href ng-click="ctrl.deleteServerGroup()"> Delete </a>
|
|
60
|
+
</li>
|
|
61
|
+
<render-if-feature feature="entityTags">
|
|
62
|
+
<add-entity-tag-links
|
|
63
|
+
component="ctrl.serverGroup"
|
|
64
|
+
application="ctrl.app"
|
|
65
|
+
entity-type="serverGroup"
|
|
66
|
+
owner-options="ctrl.entityTagTargets"
|
|
67
|
+
on-update="ctrl.app.serverGroups.refresh"
|
|
68
|
+
></add-entity-tag-links>
|
|
69
|
+
</render-if-feature>
|
|
70
|
+
</ul>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="content" ng-if="!ctrl.state.loading">
|
|
75
|
+
<kubernetes-manifest-status status="ctrl.manifest.status"></kubernetes-manifest-status>
|
|
76
|
+
<div class="band band-info" ng-if="ctrl.serverGroup.isDisabled || ctrl.serverGroup.disabled">Disabled</div>
|
|
77
|
+
<server-group-running-tasks-details
|
|
78
|
+
server-group="ctrl.serverGroup"
|
|
79
|
+
application="ctrl.app"
|
|
80
|
+
></server-group-running-tasks-details>
|
|
81
|
+
<collapsible-section heading="Information" expanded="true">
|
|
82
|
+
<dl class="dl-horizontal dl-narrow">
|
|
83
|
+
<dt>Created</dt>
|
|
84
|
+
<dd>{{ctrl.serverGroup.createdTime | timestamp}}</dd>
|
|
85
|
+
<dt>Account</dt>
|
|
86
|
+
<dd><account-tag account="ctrl.serverGroup.account"></account-tag></dd>
|
|
87
|
+
<dt>Namespace</dt>
|
|
88
|
+
<dd>{{ctrl.serverGroup.namespace}}</dd>
|
|
89
|
+
<dt>Kind</dt>
|
|
90
|
+
<dd>{{ctrl.serverGroup.kind}}</dd>
|
|
91
|
+
<dt ng-if="ctrl.manifestController()">Controller</dt>
|
|
92
|
+
<dd>
|
|
93
|
+
<a
|
|
94
|
+
ui-sref="^.serverGroupManager({
|
|
95
|
+
accountId: ctrl.serverGroup.account,
|
|
96
|
+
region: ctrl.serverGroup.region,
|
|
97
|
+
serverGroupManager: ctrl.manifestController(),
|
|
98
|
+
provider: 'kubernetes'})"
|
|
99
|
+
>
|
|
100
|
+
{{ctrl.manifestController() | robotToHuman }}
|
|
101
|
+
</a>
|
|
102
|
+
</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
</collapsible-section>
|
|
105
|
+
|
|
106
|
+
<kubernetes-annotation-custom-sections
|
|
107
|
+
manifest="ctrl.manifest.manifest"
|
|
108
|
+
resource="ctrl.serverGroup"
|
|
109
|
+
></kubernetes-annotation-custom-sections>
|
|
110
|
+
|
|
111
|
+
<collapsible-section heading="Images" expanded="true">
|
|
112
|
+
<kubernetes-manifest-image-details manifest="ctrl.manifest.manifest"></kubernetes-manifest-image-details>
|
|
113
|
+
</collapsible-section>
|
|
114
|
+
|
|
115
|
+
<collapsible-section heading="Events" expanded="true">
|
|
116
|
+
<kubernetes-manifest-events manifest="ctrl.manifest"></kubernetes-manifest-events>
|
|
117
|
+
</collapsible-section>
|
|
118
|
+
<collapsible-section heading="Labels" expanded="true">
|
|
119
|
+
<kubernetes-manifest-labels manifest="ctrl.manifest.manifest"></kubernetes-manifest-labels>
|
|
120
|
+
</collapsible-section>
|
|
121
|
+
<collapsible-section heading="Size" expanded="true">
|
|
122
|
+
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup.capacity.min == null">
|
|
123
|
+
<dt>Current</dt>
|
|
124
|
+
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
125
|
+
</dl>
|
|
126
|
+
<dl
|
|
127
|
+
class="dl-horizontal dl-narrow"
|
|
128
|
+
ng-if="ctrl.serverGroup.capacity.min != null && ctrl.serverGroup.capacity.min === ctrl.serverGroup.capacity.max"
|
|
129
|
+
>
|
|
130
|
+
<dt>Min/Max</dt>
|
|
131
|
+
<dd>{{ctrl.serverGroup.capacity.min}}</dd>
|
|
132
|
+
<dt>Current</dt>
|
|
133
|
+
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
134
|
+
</dl>
|
|
135
|
+
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup.capacity.min !== ctrl.serverGroup.capacity.max">
|
|
136
|
+
<dt>Min</dt>
|
|
137
|
+
<dd>{{ctrl.serverGroup.capacity.min}}</dd>
|
|
138
|
+
<dt>Max</dt>
|
|
139
|
+
<dd>{{ctrl.serverGroup.capacity.max}}</dd>
|
|
140
|
+
<dt>Current</dt>
|
|
141
|
+
<dd>{{ctrl.serverGroup.instances.length}}</dd>
|
|
142
|
+
</dl>
|
|
143
|
+
</collapsible-section>
|
|
144
|
+
<collapsible-section heading="Health" expanded="true">
|
|
145
|
+
<dl class="dl-horizontal dl-narrow" ng-if="ctrl.serverGroup">
|
|
146
|
+
<dt>Instances</dt>
|
|
147
|
+
<dd>
|
|
148
|
+
<health-counts container="ctrl.serverGroup.instanceCounts" class="pull-left"></health-counts>
|
|
149
|
+
</dd>
|
|
150
|
+
</dl>
|
|
151
|
+
</collapsible-section>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { IController } from 'angular';
|
|
2
|
+
import { copy, equals, module } from 'angular';
|
|
3
|
+
import type { IModalServiceInstance } from 'angular-ui-bootstrap';
|
|
4
|
+
|
|
5
|
+
import type { Application, ICapacity, ServerGroupWriter } from '@spinnaker/core';
|
|
6
|
+
import { SERVER_GROUP_WRITER, TaskMonitor } from '@spinnaker/core';
|
|
7
|
+
import type { IKubernetesServerGroup } from '../../../interfaces';
|
|
8
|
+
|
|
9
|
+
interface IResizeCommand {
|
|
10
|
+
capacity: ICapacity;
|
|
11
|
+
reason: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
class KubernetesServerGroupResizeController implements IController {
|
|
15
|
+
public taskMonitor: TaskMonitor;
|
|
16
|
+
public command: IResizeCommand;
|
|
17
|
+
public current: ICapacity;
|
|
18
|
+
public verification = {
|
|
19
|
+
verified: false,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
public static $inject = ['serverGroup', '$uibModalInstance', 'serverGroupWriter', 'application'];
|
|
23
|
+
constructor(
|
|
24
|
+
public serverGroup: IKubernetesServerGroup,
|
|
25
|
+
private $uibModalInstance: IModalServiceInstance,
|
|
26
|
+
private serverGroupWriter: ServerGroupWriter,
|
|
27
|
+
private application: Application,
|
|
28
|
+
) {
|
|
29
|
+
this.taskMonitor = new TaskMonitor({
|
|
30
|
+
title: `Resizing ${this.serverGroup.name}`,
|
|
31
|
+
application,
|
|
32
|
+
modalInstance: $uibModalInstance,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
this.current = this.serverGroup.capacity;
|
|
36
|
+
this.command = {
|
|
37
|
+
capacity: copy(this.current),
|
|
38
|
+
reason: null,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public isValid(): boolean {
|
|
43
|
+
return (
|
|
44
|
+
this.verification.verified && this.command.capacity.desired >= 0 && !equals(this.command.capacity, this.current)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public cancel(): void {
|
|
49
|
+
this.$uibModalInstance.dismiss();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public resize(): void {
|
|
53
|
+
this.taskMonitor.submit(() => {
|
|
54
|
+
const payload = {
|
|
55
|
+
capacity: this.command.capacity,
|
|
56
|
+
serverGroupName: this.serverGroup.name,
|
|
57
|
+
account: this.serverGroup.account,
|
|
58
|
+
region: this.serverGroup.region,
|
|
59
|
+
interestingHealthProviderNames: ['KubernetesPod'],
|
|
60
|
+
reason: this.command.reason,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return this.serverGroupWriter.resizeServerGroup(this.serverGroup, this.application, payload);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const KUBERNETES_SERVER_GROUP_RESIZE_CTRL = 'spinnaker.kubernetes.serverGroup.details.resize.controller';
|
|
69
|
+
|
|
70
|
+
module(KUBERNETES_SERVER_GROUP_RESIZE_CTRL, [SERVER_GROUP_WRITER]).controller(
|
|
71
|
+
'kubernetesV2ServerGroupResizeCtrl',
|
|
72
|
+
KubernetesServerGroupResizeController,
|
|
73
|
+
);
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<div modal-page class="confirmation-modal">
|
|
2
|
+
<task-monitor monitor="ctrl.taskMonitor"></task-monitor>
|
|
3
|
+
<form role="form" name="resizeForm">
|
|
4
|
+
<modal-close dismiss="$dismiss()"></modal-close>
|
|
5
|
+
<div class="modal-header">
|
|
6
|
+
<h4 class="modal-title">Resize {{ctrl.serverGroup.kind}} {{ctrl.serverGroup.displayName}}</h4>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="modal-body confirmation-modal">
|
|
9
|
+
<div class="form-horizontal">
|
|
10
|
+
<div class="form-group form-inline">
|
|
11
|
+
<div class="col-md-3 sm-label-right">Current</div>
|
|
12
|
+
<div class="col-md-3">
|
|
13
|
+
<div class="input-group">
|
|
14
|
+
<input
|
|
15
|
+
type="number"
|
|
16
|
+
class="form-control input-sm highlight-pristine"
|
|
17
|
+
ng-model="ctrl.current.desired"
|
|
18
|
+
readonly
|
|
19
|
+
/>
|
|
20
|
+
<span class="input-group-addon">pod<span ng-if="ctrl.current.desired !== 1">s</span></span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="form-group form-inline">
|
|
25
|
+
<div class="col-md-3 sm-label-right">Desired</div>
|
|
26
|
+
<div class="col-md-3">
|
|
27
|
+
<div class="input-group">
|
|
28
|
+
<input
|
|
29
|
+
type="number"
|
|
30
|
+
class="form-control input-sm highlight-pristine"
|
|
31
|
+
ng-model="ctrl.command.capacity.desired"
|
|
32
|
+
min="0"
|
|
33
|
+
required
|
|
34
|
+
/>
|
|
35
|
+
<span class="input-group-addon">pod<span ng-if="ctrl.command.capacity.desired !== 1">s</span></span>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<task-reason command="ctrl.command"></task-reason>
|
|
41
|
+
</div>
|
|
42
|
+
<div class="modal-footer">
|
|
43
|
+
<user-verification account="ctrl.serverGroup.account" verification="ctrl.verification"></user-verification>
|
|
44
|
+
<button type="submit" ng-click="ctrl.resize()" style="display: none"></button>
|
|
45
|
+
<!-- Allows form submission via enter keypress-->
|
|
46
|
+
<button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
|
|
47
|
+
<button
|
|
48
|
+
type="submit"
|
|
49
|
+
class="btn btn-primary"
|
|
50
|
+
ng-click="ctrl.resize()"
|
|
51
|
+
ng-disabled="!ctrl.isValid() || !resizeForm.$valid"
|
|
52
|
+
>
|
|
53
|
+
Submit
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
</form>
|
|
57
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
|
|
3
|
+
import type { Application } from '@spinnaker/core';
|
|
4
|
+
import type { IKubernetesManifestCommandData } from '../manifest/manifestCommandBuilder.service';
|
|
5
|
+
import { KubernetesManifestCommandBuilder } from '../manifest/manifestCommandBuilder.service';
|
|
6
|
+
|
|
7
|
+
export class KubernetesV2ServerGroupCommandBuilder {
|
|
8
|
+
public buildNewServerGroupCommand(app: Application): PromiseLike<IKubernetesManifestCommandData> {
|
|
9
|
+
return KubernetesManifestCommandBuilder.buildNewManifestCommand(app);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const KUBERNETES_SERVER_GROUP_COMMAND_BUILDER = 'spinnaker.kubernetes.serverGroup.commandBuilder.service';
|
|
14
|
+
|
|
15
|
+
module(KUBERNETES_SERVER_GROUP_COMMAND_BUILDER, []).service(
|
|
16
|
+
'kubernetesV2ServerGroupCommandBuilder',
|
|
17
|
+
KubernetesV2ServerGroupCommandBuilder,
|
|
18
|
+
);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Application } from '@spinnaker/core';
|
|
2
|
+
|
|
3
|
+
import type { IKubernetesServerGroup } from '../interfaces';
|
|
4
|
+
import { KubernetesV2ServerGroupTransformer } from './serverGroupTransformer.service';
|
|
5
|
+
|
|
6
|
+
describe('KubernetesV2ServerGroupTransformer', function () {
|
|
7
|
+
it('normalizes server group name', async () => {
|
|
8
|
+
const transformer = new KubernetesV2ServerGroupTransformer();
|
|
9
|
+
const ACCOUNT = 'myaccount';
|
|
10
|
+
const LOCATION = 'myns';
|
|
11
|
+
const SG_MANAGER = 'sgmanager';
|
|
12
|
+
const KIND = 'daemonSet';
|
|
13
|
+
|
|
14
|
+
const sgMgrRef = { account: ACCOUNT, location: LOCATION, name: SG_MANAGER };
|
|
15
|
+
const sgAccount = ({
|
|
16
|
+
account: ACCOUNT,
|
|
17
|
+
name: 'myservergroup',
|
|
18
|
+
region: LOCATION,
|
|
19
|
+
serverGroupManagers: [sgMgrRef],
|
|
20
|
+
} as unknown) as IKubernetesServerGroup;
|
|
21
|
+
|
|
22
|
+
const data = [{ name: `${KIND} ${SG_MANAGER}`, region: LOCATION, account: ACCOUNT, kind: KIND }];
|
|
23
|
+
const app = new Application('test', null, []);
|
|
24
|
+
app.getDataSource = () => {
|
|
25
|
+
return {
|
|
26
|
+
ready: () => Promise.resolve(data),
|
|
27
|
+
data,
|
|
28
|
+
} as any;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const sg = await transformer.normalizeServerGroup(sgAccount, app);
|
|
32
|
+
expect(sg).not.toBe(null);
|
|
33
|
+
expect(sg.serverGroupManagers.length).toBe(1);
|
|
34
|
+
expect(sgMgrRef.name).toBe('daemonSet sgmanager');
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('does not normalize server group if different account', async () => {
|
|
38
|
+
const transformer = new KubernetesV2ServerGroupTransformer();
|
|
39
|
+
const ACCOUNT = 'myaccount';
|
|
40
|
+
const ACCOUNT2 = 'account2';
|
|
41
|
+
const LOCATION = 'myns';
|
|
42
|
+
const SG_MANAGER = 'sgmanager';
|
|
43
|
+
const KIND = 'daemonSet';
|
|
44
|
+
|
|
45
|
+
const sgMgrRef = { account: ACCOUNT, location: LOCATION, name: SG_MANAGER };
|
|
46
|
+
const sgAccount: IKubernetesServerGroup = ({
|
|
47
|
+
account: ACCOUNT,
|
|
48
|
+
name: 'myservergroup',
|
|
49
|
+
region: LOCATION,
|
|
50
|
+
serverGroupManagers: [sgMgrRef],
|
|
51
|
+
} as unknown) as IKubernetesServerGroup;
|
|
52
|
+
|
|
53
|
+
const data = [{ name: `${KIND} ${SG_MANAGER}`, region: LOCATION, account: ACCOUNT2, kind: KIND }];
|
|
54
|
+
const app = new Application('test', null, []);
|
|
55
|
+
app.getDataSource = () => {
|
|
56
|
+
return {
|
|
57
|
+
ready: () => Promise.resolve(data),
|
|
58
|
+
data,
|
|
59
|
+
} as any;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const sg = await transformer.normalizeServerGroup(sgAccount, app);
|
|
63
|
+
expect(sg).not.toBe(null);
|
|
64
|
+
expect(sg.serverGroupManagers.length).toBe(1);
|
|
65
|
+
expect(sgMgrRef.name).toBe('sgmanager');
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { module } from 'angular';
|
|
2
|
+
import type { Application } from '@spinnaker/core';
|
|
3
|
+
import type { IKubernetesServerGroup, IKubernetesServerGroupManager } from '../interfaces';
|
|
4
|
+
|
|
5
|
+
export class KubernetesV2ServerGroupTransformer {
|
|
6
|
+
public normalizeServerGroup(
|
|
7
|
+
serverGroup: IKubernetesServerGroup,
|
|
8
|
+
application: Application,
|
|
9
|
+
): PromiseLike<IKubernetesServerGroup> {
|
|
10
|
+
return application
|
|
11
|
+
.getDataSource('serverGroupManagers')
|
|
12
|
+
.ready()
|
|
13
|
+
.then((sgManagers: IKubernetesServerGroupManager[]) => {
|
|
14
|
+
(serverGroup.serverGroupManagers || []).forEach((managerRef) => {
|
|
15
|
+
const sgManager = sgManagers.find(
|
|
16
|
+
(manager: IKubernetesServerGroupManager) =>
|
|
17
|
+
managerRef.account == manager.account &&
|
|
18
|
+
managerRef.location == manager.region &&
|
|
19
|
+
`${manager.kind} ${managerRef.name}` == manager.name,
|
|
20
|
+
);
|
|
21
|
+
if (sgManager) {
|
|
22
|
+
managerRef.name = sgManager.name;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return serverGroup;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const KUBERNETES_SERVER_GROUP_TRANSFORMER = 'spinnaker.kubernetes.serverGroup.transformer.service';
|
|
31
|
+
module(KUBERNETES_SERVER_GROUP_TRANSFORMER, []).service(
|
|
32
|
+
'kubernetesV2ServerGroupTransformer',
|
|
33
|
+
KubernetesV2ServerGroupTransformer,
|
|
34
|
+
);
|