@spinnaker/appengine 2026.2.3 → 2026.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appengine.module.d.ts +7 -1
- package/dist/domain/index.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/details/AppengineInstanceDetails.d.ts +11 -0
- package/dist/loadBalancer/configure/AppengineCreateLoadBalancerModal.d.ts +29 -0
- package/dist/loadBalancer/details/AppengineLoadBalancerActions.d.ts +5 -0
- package/dist/loadBalancer/details/AppengineLoadBalancerDetailsSection.d.ts +3 -0
- package/dist/loadBalancer/details/index.d.ts +3 -0
- package/dist/loadBalancer/details/useAppengineLoadBalancerDetails.d.ts +3 -0
- package/dist/loadBalancer/transformer.d.ts +2 -6
- package/dist/pipeline/stages/AppengineExecutionDetails.d.ts +15 -0
- package/dist/pipeline/stages/AppengineServerGroupStageConfig.d.ts +12 -0
- package/dist/pipeline/stages/destroyAsg/appengineDestroyAsgStage.d.ts +1 -1
- package/dist/pipeline/stages/disableAsg/appengineDisableAsgStage.d.ts +1 -1
- package/dist/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.d.ts +1 -1
- package/dist/pipeline/stages/enableAsg/appengineEnableAsgStage.d.ts +1 -1
- package/dist/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.d.ts +1 -1
- package/dist/pipeline/stages/startServerGroup/appengineStartServerGroupStage.d.ts +1 -1
- package/dist/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.d.ts +1 -1
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +5 -9
- package/dist/serverGroup/configure/wizard/AppengineCloneServerGroupModal.d.ts +22 -0
- package/dist/serverGroup/details/AppengineServerGroupActions.d.ts +12 -0
- package/dist/serverGroup/details/AppengineServerGroupDetailsSection.d.ts +3 -0
- package/dist/serverGroup/details/appengineServerGroupDetailsGetter.d.ts +4 -0
- package/dist/serverGroup/details/index.d.ts +3 -0
- package/dist/serverGroup/transformer.d.ts +1 -5
- package/dist/serverGroup/writer/serverGroup.write.service.d.ts +15 -4
- package/package.json +4 -8
- package/src/appengine.module.spec.ts +194 -0
- package/src/appengine.module.ts +47 -58
- package/src/domain/index.ts +0 -1
- package/src/index.ts +1 -1
- package/src/instance/details/AppengineInstanceDetails.tsx +33 -0
- package/src/loadBalancer/configure/AppengineCreateLoadBalancerModal.tsx +342 -0
- package/src/loadBalancer/details/AppengineLoadBalancerActions.tsx +66 -0
- package/src/loadBalancer/details/AppengineLoadBalancerDetailsSection.tsx +42 -0
- package/src/loadBalancer/details/index.ts +3 -0
- package/src/loadBalancer/details/useAppengineLoadBalancerDetails.ts +37 -0
- package/src/loadBalancer/transformer.ts +3 -14
- package/src/pipeline/stages/AppengineExecutionDetails.tsx +90 -0
- package/src/pipeline/stages/AppengineServerGroupStageConfig.tsx +190 -0
- package/src/pipeline/stages/destroyAsg/appengineDestroyAsgStage.ts +17 -43
- package/src/pipeline/stages/disableAsg/appengineDisableAsgStage.ts +18 -53
- package/src/pipeline/stages/editLoadBalancer/AppengineEditLoadBalancerStageConfig.tsx +94 -0
- package/src/pipeline/stages/editLoadBalancer/appengineEditLoadBalancerStage.ts +14 -74
- package/src/pipeline/stages/enableAsg/appengineEnableAsgStage.ts +13 -48
- package/src/pipeline/stages/shrinkCluster/appengineShrinkClusterStage.ts +13 -61
- package/src/pipeline/stages/startServerGroup/appengineStartServerGroupStage.ts +17 -54
- package/src/pipeline/stages/stopServerGroup/appengineStopServerGroupStage.ts +17 -54
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +20 -19
- package/src/serverGroup/configure/wizard/AppengineCloneServerGroupModal.tsx +119 -0
- package/src/serverGroup/configure/wizard/serverGroupWizard.less +0 -8
- package/src/serverGroup/details/AppengineServerGroupActions.tsx +245 -0
- package/src/serverGroup/details/AppengineServerGroupDetailsSection.tsx +27 -0
- package/src/serverGroup/details/appengineServerGroupDetailsGetter.ts +62 -0
- package/src/serverGroup/details/index.ts +3 -0
- package/src/serverGroup/transformer.ts +3 -15
- package/src/serverGroup/writer/serverGroup.write.service.ts +57 -8
- package/dist/common/componentUrlDetails.component.d.ts +0 -1
- package/dist/common/conditionalDescriptionListItem.component.d.ts +0 -1
- package/dist/common/loadBalancerMessage.component.d.ts +0 -1
- package/dist/domain/IAppengineStageScope.d.ts +0 -18
- package/dist/instance/details/details.controller.d.ts +0 -1
- package/dist/loadBalancer/configure/wizard/advancedSettings.component.d.ts +0 -1
- package/dist/loadBalancer/configure/wizard/allocationConfigurationRow.component.d.ts +0 -1
- package/dist/loadBalancer/configure/wizard/basicSettings.component.d.ts +0 -1
- package/dist/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.d.ts +0 -1
- package/dist/loadBalancer/configure/wizard/wizard.controller.d.ts +0 -2
- package/dist/loadBalancer/details/details.controller.d.ts +0 -1
- package/dist/loadBalancer/loadBalancer.module.d.ts +0 -1
- package/dist/pipeline/pipeline.module.d.ts +0 -1
- package/dist/pipeline/stages/appengineStage.controller.d.ts +0 -12
- package/dist/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.d.ts +0 -1
- package/dist/serverGroup/configure/wizard/basicSettings.controller.d.ts +0 -1
- package/dist/serverGroup/configure/wizard/cloneServerGroup.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/configFileArtifactList.module.d.ts +0 -1
- package/dist/serverGroup/configure/wizard/configFiles.component.d.ts +0 -20
- package/dist/serverGroup/configure/wizard/dynamicBranchLabel.component.d.ts +0 -1
- package/dist/serverGroup/details/details.controller.d.ts +0 -1
- package/src/common/componentUrlDetails.component.ts +0 -29
- package/src/common/conditionalDescriptionListItem.component.ts +0 -37
- package/src/common/loadBalancerMessage.component.html +0 -33
- package/src/common/loadBalancerMessage.component.ts +0 -13
- package/src/domain/IAppengineStageScope.ts +0 -22
- package/src/instance/details/details.controller.ts +0 -116
- package/src/instance/details/details.html +0 -99
- package/src/loadBalancer/configure/wizard/advancedSettings.component.ts +0 -56
- package/src/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts +0 -70
- package/src/loadBalancer/configure/wizard/basicSettings.component.html +0 -65
- package/src/loadBalancer/configure/wizard/basicSettings.component.ts +0 -98
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.html +0 -117
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts +0 -108
- package/src/loadBalancer/configure/wizard/wizard.controller.ts +0 -163
- package/src/loadBalancer/configure/wizard/wizard.html +0 -44
- package/src/loadBalancer/configure/wizard/wizard.less +0 -17
- package/src/loadBalancer/details/details.controller.ts +0 -151
- package/src/loadBalancer/details/details.html +0 -102
- package/src/loadBalancer/loadBalancer.module.ts +0 -21
- package/src/pipeline/pipeline.module.ts +0 -20
- package/src/pipeline/stages/appengineStage.controller.ts +0 -45
- package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +0 -16
- package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableAsg/disableAsgStage.html +0 -18
- package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/editLoadBalancer/editLoadBalancerExecutionDetails.html +0 -33
- package/src/pipeline/stages/editLoadBalancer/editLoadBalancerStage.html +0 -51
- package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.ts +0 -65
- package/src/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.html +0 -45
- package/src/pipeline/stages/enableAsg/enableAsgStage.html +0 -18
- package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +0 -41
- package/src/pipeline/stages/startServerGroup/startServerGroupExecutionDetails.html +0 -26
- package/src/pipeline/stages/startServerGroup/startServerGroupStage.html +0 -18
- package/src/pipeline/stages/startServerGroup/startServerGroupStepLabel.html +0 -1
- package/src/pipeline/stages/stopServerGroup/stopServerGroupExecutionDetails.html +0 -26
- package/src/pipeline/stages/stopServerGroup/stopServerGroupStage.html +0 -18
- package/src/pipeline/stages/stopServerGroup/stopServerGroupStepLabel.html +0 -1
- package/src/serverGroup/configure/wizard/advancedSettings.html +0 -33
- package/src/serverGroup/configure/wizard/basicSettings.controller.ts +0 -151
- package/src/serverGroup/configure/wizard/basicSettings.html +0 -287
- package/src/serverGroup/configure/wizard/cloneServerGroup.controller.ts +0 -103
- package/src/serverGroup/configure/wizard/configFileArtifactList.module.ts +0 -18
- package/src/serverGroup/configure/wizard/configFiles.component.html +0 -81
- package/src/serverGroup/configure/wizard/configFiles.component.ts +0 -121
- package/src/serverGroup/configure/wizard/dynamicBranchLabel.component.ts +0 -19
- package/src/serverGroup/configure/wizard/serverGroupWizard.html +0 -39
- package/src/serverGroup/details/details.controller.ts +0 -463
- package/src/serverGroup/details/details.html +0 -229
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
<div class="details-panel">
|
|
2
|
-
<div class="header">
|
|
3
|
-
<instance-details-header
|
|
4
|
-
health-state="ctrl.instance.healthState"
|
|
5
|
-
instance-id="ctrl.instance ? ctrl.instance.name : ctrl.instanceIdNotFound"
|
|
6
|
-
loading="ctrl.state.loading"
|
|
7
|
-
standalone="false"
|
|
8
|
-
></instance-details-header>
|
|
9
|
-
<div ng-if="!ctrl.state.loading">
|
|
10
|
-
<div class="actions">
|
|
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>
|
|
13
|
-
Instance Actions <span class="caret"></span>
|
|
14
|
-
</button>
|
|
15
|
-
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
16
|
-
<li><a href ng-click="ctrl.terminateInstance()">Terminate</a></li>
|
|
17
|
-
</ul>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="content" ng-if="!ctrl.state.loading && ctrl.instance">
|
|
23
|
-
<collapsible-section heading="Instance Information" expanded="true">
|
|
24
|
-
<dl class="dl-horizontal dl-narrow">
|
|
25
|
-
<dt>Launched</dt>
|
|
26
|
-
<dd ng-if="ctrl.instance.launchTime">{{ctrl.instance.launchTime | timestamp}}</dd>
|
|
27
|
-
<dt>In</dt>
|
|
28
|
-
<dd><account-tag account="ctrl.instance.account" pad="right"></account-tag>{{}}</dd>
|
|
29
|
-
<dt ng-if="ctrl.instance.serverGroup">Server Group</dt>
|
|
30
|
-
<dd ng-if="ctrl.instance.serverGroup">
|
|
31
|
-
<a
|
|
32
|
-
ui-sref="^.serverGroup({region: ctrl.instance.region,
|
|
33
|
-
accountId: ctrl.instance.account,
|
|
34
|
-
serverGroup: ctrl.instance.serverGroup,
|
|
35
|
-
provider: 'appengine'})"
|
|
36
|
-
>{{ctrl.instance.serverGroup}}</a
|
|
37
|
-
>
|
|
38
|
-
</dd>
|
|
39
|
-
<dt>Region</dt>
|
|
40
|
-
<dd>{{ctrl.instance.region}}</dd>
|
|
41
|
-
<appengine-conditional-dt-dd
|
|
42
|
-
component="ctrl.instance"
|
|
43
|
-
key="vmZoneName"
|
|
44
|
-
label="Zone"
|
|
45
|
-
></appengine-conditional-dt-dd>
|
|
46
|
-
</dl>
|
|
47
|
-
</collapsible-section>
|
|
48
|
-
<collapsible-section heading="Status" expanded="true">
|
|
49
|
-
<dl>
|
|
50
|
-
<dt>Load Balancer</dt>
|
|
51
|
-
<dd>
|
|
52
|
-
<span
|
|
53
|
-
class="pull-left"
|
|
54
|
-
uib-tooltip="{{ctrl.instance.healthState === 'Up' ? ctrl.upToolTip : ctrl.outOfServiceToolTip}}"
|
|
55
|
-
tooltip-placement="right"
|
|
56
|
-
>
|
|
57
|
-
<span class="glyphicon glyphicon-{{ctrl.instance.healthState}}-triangle"></span>
|
|
58
|
-
{{ctrl.instance.loadBalancers[0]}}
|
|
59
|
-
</span>
|
|
60
|
-
</dd>
|
|
61
|
-
</dl>
|
|
62
|
-
</collapsible-section>
|
|
63
|
-
<collapsible-section heading="Metrics" expanded="true">
|
|
64
|
-
<dl>
|
|
65
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="instanceStatus" label="Availability">
|
|
66
|
-
<key-label><help-field key="appengine.instance.availability"></help-field></key-label>
|
|
67
|
-
</appengine-conditional-dt-dd>
|
|
68
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="averageLatency">
|
|
69
|
-
<key-label><help-field key="appengine.instance.averageLatency"></help-field></key-label>
|
|
70
|
-
<value-label>ms</value-label>
|
|
71
|
-
</appengine-conditional-dt-dd>
|
|
72
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="errors">
|
|
73
|
-
<key-label><help-field key="appengine.instance.errors"></help-field></key-label>
|
|
74
|
-
</appengine-conditional-dt-dd>
|
|
75
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="qps" label="QPS">
|
|
76
|
-
<key-label><help-field key="appengine.instance.qps"></help-field></key-label>
|
|
77
|
-
</appengine-conditional-dt-dd>
|
|
78
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="requests">
|
|
79
|
-
<key-label><help-field key="appengine.instance.requests"></help-field></key-label>
|
|
80
|
-
</appengine-conditional-dt-dd>
|
|
81
|
-
<appengine-conditional-dt-dd component="ctrl.instance" key="vmStatus" label="VM Status">
|
|
82
|
-
<key-label><help-field key="appengine.instance.vmStatus"></help-field></key-label>
|
|
83
|
-
</appengine-conditional-dt-dd>
|
|
84
|
-
<appengine-conditional-dt-dd
|
|
85
|
-
component="ctrl.instance"
|
|
86
|
-
key="vmDebugEnabled"
|
|
87
|
-
label="Debug Enabled"
|
|
88
|
-
></appengine-conditional-dt-dd>
|
|
89
|
-
</dl>
|
|
90
|
-
</collapsible-section>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="content" ng-if="!ctrl.state.loading && !ctrl.instance">
|
|
93
|
-
<div class="content-section">
|
|
94
|
-
<div class="content-body text-center">
|
|
95
|
-
<h3>Instance not found.</h3>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { IComponentOptions, IController } from 'angular';
|
|
2
|
-
import { module } from 'angular';
|
|
3
|
-
|
|
4
|
-
import type { AppengineLoadBalancerUpsertDescription } from '../../transformer';
|
|
5
|
-
|
|
6
|
-
class AppengineLoadBalancerAdvancedSettingsCtrl implements IController {
|
|
7
|
-
public state = { error: false };
|
|
8
|
-
public loadBalancer: AppengineLoadBalancerUpsertDescription;
|
|
9
|
-
|
|
10
|
-
public disableMigrateTraffic(): boolean {
|
|
11
|
-
if (this.loadBalancer.splitDescription.allocationDescriptions.length !== 1) {
|
|
12
|
-
return true;
|
|
13
|
-
} else {
|
|
14
|
-
const targetServerGroupName = this.loadBalancer.splitDescription.allocationDescriptions[0].serverGroupName;
|
|
15
|
-
const targetServerGroup = this.loadBalancer.serverGroups.find(
|
|
16
|
-
(candidate) => candidate.name === targetServerGroupName,
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
if (targetServerGroup) {
|
|
20
|
-
return !targetServerGroup.allowsGradualTrafficMigration;
|
|
21
|
-
} else {
|
|
22
|
-
// If the target server group name is not in the load balancer's server groups, then hopefully we are in
|
|
23
|
-
// a pipeline stage - we'll leave it up to the user to make smart decisions.
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const appengineLoadBalancerAdvancedSettingsComponent: IComponentOptions = {
|
|
31
|
-
bindings: { loadBalancer: '=', application: '<' },
|
|
32
|
-
template: `
|
|
33
|
-
<ng-form name="advancedSettingsForm">
|
|
34
|
-
<div class="row">
|
|
35
|
-
<div class="form-group">
|
|
36
|
-
<div class="col-md-3 sm-label-right">
|
|
37
|
-
Migrate Traffic <help-field key="appengine.loadBalancer.migrateTraffic"></help-field>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="col-md-9">
|
|
40
|
-
<div class="checkbox">
|
|
41
|
-
<input type="checkbox" ng-disabled="$ctrl.disableMigrateTraffic() && !($ctrl.loadBalancer.migrateTraffic = false)" ng-model="$ctrl.loadBalancer.migrateTraffic">
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</ng-form>
|
|
47
|
-
`,
|
|
48
|
-
controller: AppengineLoadBalancerAdvancedSettingsCtrl,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS = 'spinnaker.appengine.loadBalancer.advancedSettings.component';
|
|
52
|
-
|
|
53
|
-
module(APPENGINE_LOAD_BALANCER_ADVANCED_SETTINGS, []).component(
|
|
54
|
-
'appengineLoadBalancerAdvancedSettings',
|
|
55
|
-
appengineLoadBalancerAdvancedSettingsComponent,
|
|
56
|
-
);
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { IComponentOptions, IController } from 'angular';
|
|
2
|
-
import { module } from 'angular';
|
|
3
|
-
import { uniq } from 'lodash';
|
|
4
|
-
|
|
5
|
-
import type { IAppengineAllocationDescription } from '../../transformer';
|
|
6
|
-
|
|
7
|
-
class AppengineAllocationConfigurationRowCtrl implements IController {
|
|
8
|
-
public allocationDescription: IAppengineAllocationDescription;
|
|
9
|
-
public serverGroupOptions: string[];
|
|
10
|
-
|
|
11
|
-
public getServerGroupOptions(): string[] {
|
|
12
|
-
if (this.allocationDescription.serverGroupName) {
|
|
13
|
-
return uniq(this.serverGroupOptions.concat(this.allocationDescription.serverGroupName));
|
|
14
|
-
} else {
|
|
15
|
-
return this.serverGroupOptions;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const appengineAllocationConfigurationRowComponent: IComponentOptions = {
|
|
21
|
-
bindings: {
|
|
22
|
-
allocationDescription: '<',
|
|
23
|
-
removeAllocation: '&',
|
|
24
|
-
serverGroupOptions: '<',
|
|
25
|
-
onAllocationChange: '&',
|
|
26
|
-
},
|
|
27
|
-
template: `
|
|
28
|
-
<div class="form-group">
|
|
29
|
-
<div class="row">
|
|
30
|
-
<div class="col-md-7">
|
|
31
|
-
<ui-select ng-model="$ctrl.allocationDescription.serverGroupName"
|
|
32
|
-
on-select="$ctrl.onAllocationChange()"
|
|
33
|
-
class="form-control input-sm">
|
|
34
|
-
<ui-select-match placeholder="Select...">
|
|
35
|
-
{{$select.selected}}
|
|
36
|
-
</ui-select-match>
|
|
37
|
-
<ui-select-choices repeat="serverGroup as serverGroup in $ctrl.getServerGroupOptions() | filter: $select.search">
|
|
38
|
-
<div ng-bind-html="serverGroup | highlight: $select.search"></div>
|
|
39
|
-
</ui-select-choices>
|
|
40
|
-
</ui-select>
|
|
41
|
-
</div>
|
|
42
|
-
<div class="col-md-3">
|
|
43
|
-
<div class="input-group input-group-sm">
|
|
44
|
-
<input type="number"
|
|
45
|
-
ng-model="$ctrl.allocationDescription.allocation"
|
|
46
|
-
required
|
|
47
|
-
class="form-control input-sm"
|
|
48
|
-
min="0"
|
|
49
|
-
ng-change="$ctrl.onAllocationChange()"
|
|
50
|
-
max="100"/>
|
|
51
|
-
<span class="input-group-addon">%</span>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="col-md-2">
|
|
55
|
-
<a class="btn btn-link sm-label" ng-click="$ctrl.removeAllocation()">
|
|
56
|
-
<span class="glyphicon glyphicon-trash"></span>
|
|
57
|
-
</a>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
`,
|
|
62
|
-
controller: AppengineAllocationConfigurationRowCtrl,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export const APPENGINE_ALLOCATION_CONFIGURATION_ROW = 'spinnaker.appengine.allocationConfigurationRow.component';
|
|
66
|
-
|
|
67
|
-
module(APPENGINE_ALLOCATION_CONFIGURATION_ROW, []).component(
|
|
68
|
-
'appengineAllocationConfigurationRow',
|
|
69
|
-
appengineAllocationConfigurationRowComponent,
|
|
70
|
-
);
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<ng-form name="basicSettingsForm">
|
|
2
|
-
<div class="row">
|
|
3
|
-
<div class="form-group">
|
|
4
|
-
<div class="col-md-3 sm-label-right">
|
|
5
|
-
Allocations
|
|
6
|
-
<help-field key="appengine.loadBalancer.allocations"></help-field>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="col-md-9">
|
|
9
|
-
<div ng-if="!$ctrl.forPipelineConfig">
|
|
10
|
-
<appengine-allocation-configuration-row
|
|
11
|
-
ng-repeat="description in $ctrl.loadBalancer.splitDescription.allocationDescriptions"
|
|
12
|
-
allocation-description="description"
|
|
13
|
-
server-group-options="$ctrl.serverGroupOptions"
|
|
14
|
-
on-allocation-change="$ctrl.updateServerGroupOptions()"
|
|
15
|
-
remove-allocation="$ctrl.removeAllocation($index)"
|
|
16
|
-
>
|
|
17
|
-
</appengine-allocation-configuration-row>
|
|
18
|
-
</div>
|
|
19
|
-
<div ng-if="$ctrl.forPipelineConfig">
|
|
20
|
-
<appengine-stage-allocation-configuration-row
|
|
21
|
-
ng-repeat="description in $ctrl.loadBalancer.splitDescription.allocationDescriptions"
|
|
22
|
-
allocation-description="description"
|
|
23
|
-
application="$ctrl.application"
|
|
24
|
-
region="{{ $ctrl.loadBalancer.region }}"
|
|
25
|
-
account="{{ $ctrl.loadBalancer.account || $ctrl.loadBalancer.credentials }}"
|
|
26
|
-
server-group-options="$ctrl.serverGroupOptions"
|
|
27
|
-
on-allocation-change="$ctrl.updateServerGroupOptions()"
|
|
28
|
-
remove-allocation="$ctrl.removeAllocation($index)"
|
|
29
|
-
>
|
|
30
|
-
</appengine-stage-allocation-configuration-row>
|
|
31
|
-
</div>
|
|
32
|
-
<button class="add-new col-md-11" ng-if="$ctrl.showAddButton()" ng-click="$ctrl.addAllocation()">
|
|
33
|
-
<span class="glyphicon glyphicon-plus-sign"></span> Add allocation
|
|
34
|
-
</button>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="form-group" ng-if="$ctrl.allocationIsInvalid()">
|
|
38
|
-
<div class="col-md-12 text-center">
|
|
39
|
-
<p class="alert alert-warning">Allocations must sum to 100%.</p>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div class="row" ng-if="$ctrl.showShardByOptions()">
|
|
45
|
-
<div class="form-group">
|
|
46
|
-
<div class="col-md-3 sm-label-right">Shard By</div>
|
|
47
|
-
<div class="col-md-9">
|
|
48
|
-
<form class="form-inline">
|
|
49
|
-
<div class="form-group">
|
|
50
|
-
<label class="radio-inline">
|
|
51
|
-
<input type="radio" ng-model="$ctrl.loadBalancer.splitDescription.shardBy" value="IP" />
|
|
52
|
-
IP
|
|
53
|
-
<help-field key="appengine.loadBalancer.shardBy.ip"></help-field>
|
|
54
|
-
</label>
|
|
55
|
-
<label class="radio-inline">
|
|
56
|
-
<input type="radio" ng-model="$ctrl.loadBalancer.splitDescription.shardBy" value="COOKIE" />
|
|
57
|
-
Cookie
|
|
58
|
-
<help-field key="appengine.loadBalancer.shardBy.cookie"></help-field>
|
|
59
|
-
</label>
|
|
60
|
-
</div>
|
|
61
|
-
</form>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</ng-form>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import type { IController } from 'angular';
|
|
2
|
-
import { module } from 'angular';
|
|
3
|
-
import { difference } from 'lodash';
|
|
4
|
-
|
|
5
|
-
import type { AppengineLoadBalancerUpsertDescription } from '../../transformer';
|
|
6
|
-
|
|
7
|
-
class AppengineLoadBalancerSettingsController implements IController {
|
|
8
|
-
public loadBalancer: AppengineLoadBalancerUpsertDescription;
|
|
9
|
-
public serverGroupOptions: string[];
|
|
10
|
-
public forPipelineConfig: boolean;
|
|
11
|
-
|
|
12
|
-
public $onInit(): void {
|
|
13
|
-
this.updateServerGroupOptions();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public addAllocation(): void {
|
|
17
|
-
const remainingServerGroups = this.serverGroupsWithoutAllocation();
|
|
18
|
-
if (remainingServerGroups.length) {
|
|
19
|
-
this.loadBalancer.splitDescription.allocationDescriptions.push({
|
|
20
|
-
serverGroupName: remainingServerGroups[0],
|
|
21
|
-
allocation: 0,
|
|
22
|
-
locatorType: 'fromExisting',
|
|
23
|
-
});
|
|
24
|
-
if (
|
|
25
|
-
this.loadBalancer.splitDescription.allocationDescriptions.length > 1 &&
|
|
26
|
-
!this.loadBalancer.splitDescription.shardBy
|
|
27
|
-
) {
|
|
28
|
-
this.loadBalancer.splitDescription.shardBy = 'IP';
|
|
29
|
-
}
|
|
30
|
-
this.updateServerGroupOptions();
|
|
31
|
-
} else if (this.forPipelineConfig) {
|
|
32
|
-
this.loadBalancer.splitDescription.allocationDescriptions.push({
|
|
33
|
-
allocation: 0,
|
|
34
|
-
locatorType: 'text',
|
|
35
|
-
serverGroupName: '',
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public removeAllocation(index: number): void {
|
|
41
|
-
this.loadBalancer.splitDescription.allocationDescriptions.splice(index, 1);
|
|
42
|
-
this.updateServerGroupOptions();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public allocationIsInvalid(): boolean {
|
|
46
|
-
return (
|
|
47
|
-
this.loadBalancer.splitDescription.allocationDescriptions.reduce(
|
|
48
|
-
(sum, allocationDescription) => sum + allocationDescription.allocation,
|
|
49
|
-
0,
|
|
50
|
-
) !== 100
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public updateServerGroupOptions(): void {
|
|
55
|
-
this.serverGroupOptions = this.serverGroupsWithoutAllocation();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public showAddButton(): boolean {
|
|
59
|
-
if (this.forPipelineConfig) {
|
|
60
|
-
return true;
|
|
61
|
-
} else {
|
|
62
|
-
return this.serverGroupsWithoutAllocation().length > 0;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public showShardByOptions(): boolean {
|
|
67
|
-
return this.loadBalancer.splitDescription.allocationDescriptions.length > 1 || this.loadBalancer.migrateTraffic;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public initializeAsTextInput(serverGroupName: string): boolean {
|
|
71
|
-
if (this.forPipelineConfig) {
|
|
72
|
-
return !this.loadBalancer.serverGroups.map((serverGroup) => serverGroup.name).includes(serverGroupName);
|
|
73
|
-
} else {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
private serverGroupsWithoutAllocation(): string[] {
|
|
79
|
-
const serverGroupsWithAllocation = this.loadBalancer.splitDescription.allocationDescriptions.map(
|
|
80
|
-
(description) => description.serverGroupName,
|
|
81
|
-
);
|
|
82
|
-
const allServerGroups = this.loadBalancer.serverGroups.map((serverGroup) => serverGroup.name);
|
|
83
|
-
return difference(allServerGroups, serverGroupsWithAllocation);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const appengineLoadBalancerSettingsComponent: ng.IComponentOptions = {
|
|
88
|
-
bindings: { loadBalancer: '=', forPipelineConfig: '<', application: '<' },
|
|
89
|
-
controller: AppengineLoadBalancerSettingsController,
|
|
90
|
-
templateUrl: require('./basicSettings.component.html'),
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export const APPENGINE_LOAD_BALANCER_BASIC_SETTINGS = 'spinnaker.appengine.loadBalancerSettings.component';
|
|
94
|
-
|
|
95
|
-
module(APPENGINE_LOAD_BALANCER_BASIC_SETTINGS, []).component(
|
|
96
|
-
'appengineLoadBalancerBasicSettings',
|
|
97
|
-
appengineLoadBalancerSettingsComponent,
|
|
98
|
-
);
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
<div class="form-group">
|
|
2
|
-
<div class="row">
|
|
3
|
-
<div class="col-md-7">
|
|
4
|
-
<appengine-stage-allocation-label allocation-description="$ctrl.allocationDescription">
|
|
5
|
-
</appengine-stage-allocation-label>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="col-md-3">
|
|
8
|
-
<div class="input-group input-group-sm">
|
|
9
|
-
<input
|
|
10
|
-
type="number"
|
|
11
|
-
ng-model="$ctrl.allocationDescription.allocation"
|
|
12
|
-
required
|
|
13
|
-
class="form-control input-sm"
|
|
14
|
-
min="0"
|
|
15
|
-
ng-change="$ctrl.onAllocationChange()"
|
|
16
|
-
max="100"
|
|
17
|
-
/>
|
|
18
|
-
<span class="input-group-addon">%</span>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="col-md-2">
|
|
22
|
-
<a class="btn btn-link sm-label" ng-click="$ctrl.removeAllocation()">
|
|
23
|
-
<span class="glyphicon glyphicon-trash"></span>
|
|
24
|
-
</a>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="form-group">
|
|
29
|
-
<div class="well col-md-11" style="padding-top: 5px; padding-bottom: 10px">
|
|
30
|
-
<div class="row">
|
|
31
|
-
<div class="form-group">
|
|
32
|
-
<div class="col-md-3 sm-label-right">Locator</div>
|
|
33
|
-
<div class="col-md-7">
|
|
34
|
-
<form>
|
|
35
|
-
<div class="form-group">
|
|
36
|
-
<label class="small" style="font-weight: normal">
|
|
37
|
-
<input
|
|
38
|
-
type="radio"
|
|
39
|
-
ng-change="$ctrl.onLocatorTypeChange()"
|
|
40
|
-
ng-model="$ctrl.allocationDescription.locatorType"
|
|
41
|
-
value="fromExisting"
|
|
42
|
-
/>
|
|
43
|
-
Existing server group
|
|
44
|
-
</label>
|
|
45
|
-
<br />
|
|
46
|
-
<label class="small" style="font-weight: normal">
|
|
47
|
-
<input
|
|
48
|
-
type="radio"
|
|
49
|
-
ng-change="$ctrl.onLocatorTypeChange()"
|
|
50
|
-
ng-model="$ctrl.allocationDescription.locatorType"
|
|
51
|
-
value="targetCoordinate"
|
|
52
|
-
/>
|
|
53
|
-
Coordinates
|
|
54
|
-
</label>
|
|
55
|
-
<br />
|
|
56
|
-
<label class="small" style="font-weight: normal">
|
|
57
|
-
<input
|
|
58
|
-
type="radio"
|
|
59
|
-
ng-change="$ctrl.onLocatorTypeChange()"
|
|
60
|
-
ng-model="$ctrl.allocationDescription.locatorType"
|
|
61
|
-
value="text"
|
|
62
|
-
/>
|
|
63
|
-
Text input
|
|
64
|
-
</label>
|
|
65
|
-
</div>
|
|
66
|
-
</form>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="row">
|
|
71
|
-
<div class="form-group" ng-switch on="$ctrl.allocationDescription.locatorType">
|
|
72
|
-
<div ng-switch-when="fromExisting">
|
|
73
|
-
<div class="col-md-3 sm-label-right" style="padding-left: 0px">Server group</div>
|
|
74
|
-
<div class="col-md-7">
|
|
75
|
-
<ui-select
|
|
76
|
-
ng-model="$ctrl.allocationDescription.serverGroupName"
|
|
77
|
-
on-select="$ctrl.onAllocationChange()"
|
|
78
|
-
class="form-control input-sm"
|
|
79
|
-
>
|
|
80
|
-
<ui-select-match placeholder="Select...">
|
|
81
|
-
{{ $select.selected }}
|
|
82
|
-
</ui-select-match>
|
|
83
|
-
<ui-select-choices
|
|
84
|
-
repeat="serverGroup as serverGroup in $ctrl.getServerGroupOptions() | filter: $select.search"
|
|
85
|
-
>
|
|
86
|
-
<div ng-bind-html="serverGroup | highlight: $select.search"></div>
|
|
87
|
-
</ui-select-choices>
|
|
88
|
-
</ui-select>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
<div ng-switch-when="targetCoordinate">
|
|
92
|
-
<div class="col-md-3 sm-label-right">Cluster</div>
|
|
93
|
-
<div class="col-md-7">
|
|
94
|
-
<cluster-selector
|
|
95
|
-
class="small"
|
|
96
|
-
clusters="$ctrl.clusterList"
|
|
97
|
-
model="$ctrl.allocationDescription.cluster"
|
|
98
|
-
></cluster-selector>
|
|
99
|
-
</div>
|
|
100
|
-
<div class="col-md-3 sm-label-right">Target</div>
|
|
101
|
-
<div class="col-md-7">
|
|
102
|
-
<target-select model="$ctrl.allocationDescription" options="$ctrl.targets"></target-select>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
<div ng-switch-when="text">
|
|
106
|
-
<div class="col-md-3 sm-label-right">
|
|
107
|
-
Text
|
|
108
|
-
<help-field key="appengine.loadBalancer.textLocator"></help-field>
|
|
109
|
-
</div>
|
|
110
|
-
<div class="col-md-7">
|
|
111
|
-
<input class="form-control input-sm" type="text" ng-model="$ctrl.allocationDescription.serverGroupName" />
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import type { IComponentOptions, IController } from 'angular';
|
|
2
|
-
import { module } from 'angular';
|
|
3
|
-
import { uniq } from 'lodash';
|
|
4
|
-
|
|
5
|
-
import type { Application } from '@spinnaker/core';
|
|
6
|
-
import { AppListExtractor, StageConstants } from '@spinnaker/core';
|
|
7
|
-
|
|
8
|
-
import type { IAppengineAllocationDescription } from '../../transformer';
|
|
9
|
-
|
|
10
|
-
class AppengineStageAllocationLabelCtrl implements IController {
|
|
11
|
-
public inputViewValue: string;
|
|
12
|
-
private allocationDescription: IAppengineAllocationDescription;
|
|
13
|
-
|
|
14
|
-
private static mapTargetCoordinateToLabel(targetCoordinate: string): string {
|
|
15
|
-
const target = StageConstants.TARGET_LIST.find((t) => t.val === targetCoordinate);
|
|
16
|
-
if (target) {
|
|
17
|
-
return target.label;
|
|
18
|
-
} else {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public $doCheck(): void {
|
|
24
|
-
this.setInputViewValue();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
private setInputViewValue(): void {
|
|
28
|
-
switch (this.allocationDescription.locatorType) {
|
|
29
|
-
case 'text':
|
|
30
|
-
this.inputViewValue = this.allocationDescription.serverGroupName;
|
|
31
|
-
break;
|
|
32
|
-
case 'fromExisting':
|
|
33
|
-
this.inputViewValue = this.allocationDescription.serverGroupName;
|
|
34
|
-
break;
|
|
35
|
-
case 'targetCoordinate':
|
|
36
|
-
if (this.allocationDescription.cluster && this.allocationDescription.target) {
|
|
37
|
-
const targetLabel = AppengineStageAllocationLabelCtrl.mapTargetCoordinateToLabel(
|
|
38
|
-
this.allocationDescription.target,
|
|
39
|
-
);
|
|
40
|
-
this.inputViewValue = `${targetLabel} (${this.allocationDescription.cluster})`;
|
|
41
|
-
} else {
|
|
42
|
-
this.inputViewValue = null;
|
|
43
|
-
}
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
this.inputViewValue = null;
|
|
47
|
-
break;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const appengineStageAllocationLabel: IComponentOptions = {
|
|
53
|
-
bindings: { allocationDescription: '<' },
|
|
54
|
-
controller: AppengineStageAllocationLabelCtrl,
|
|
55
|
-
template: `<input ng-model="$ctrl.inputViewValue" type="text" class="form-control input-sm" readonly/>`,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
class AppengineStageAllocationConfigurationRowCtrl implements IController {
|
|
59
|
-
public allocationDescription: IAppengineAllocationDescription;
|
|
60
|
-
public serverGroupOptions: string[];
|
|
61
|
-
public targets = StageConstants.TARGET_LIST;
|
|
62
|
-
public clusterList: string[];
|
|
63
|
-
public onAllocationChange: Function;
|
|
64
|
-
private application: Application;
|
|
65
|
-
private region: string;
|
|
66
|
-
private account: string;
|
|
67
|
-
|
|
68
|
-
public $onInit() {
|
|
69
|
-
const clusterFilter = AppListExtractor.clusterFilterForCredentialsAndRegion(this.account, this.region);
|
|
70
|
-
this.clusterList = AppListExtractor.getClusters([this.application], clusterFilter);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public getServerGroupOptions(): string[] {
|
|
74
|
-
if (this.allocationDescription.serverGroupName) {
|
|
75
|
-
return uniq(this.serverGroupOptions.concat(this.allocationDescription.serverGroupName));
|
|
76
|
-
} else {
|
|
77
|
-
return this.serverGroupOptions;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
public onLocatorTypeChange(): void {
|
|
82
|
-
// Prevents pipeline expressions (or non-existent server groups) from entering the dropdown.
|
|
83
|
-
if (!this.serverGroupOptions.includes(this.allocationDescription.serverGroupName)) {
|
|
84
|
-
delete this.allocationDescription.serverGroupName;
|
|
85
|
-
}
|
|
86
|
-
this.onAllocationChange();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const appengineStageAllocationConfigurationRow: IComponentOptions = {
|
|
91
|
-
bindings: {
|
|
92
|
-
application: '<',
|
|
93
|
-
region: '@',
|
|
94
|
-
account: '@',
|
|
95
|
-
allocationDescription: '<',
|
|
96
|
-
removeAllocation: '&',
|
|
97
|
-
serverGroupOptions: '<',
|
|
98
|
-
onAllocationChange: '&',
|
|
99
|
-
},
|
|
100
|
-
controller: AppengineStageAllocationConfigurationRowCtrl,
|
|
101
|
-
templateUrl: require('./stageAllocationConfigurationRow.component.html'),
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export const APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW =
|
|
105
|
-
'spinnaker.appengine.stageAllocationConfigurationRow.component';
|
|
106
|
-
module(APPENGINE_STAGE_ALLOCATION_CONFIGURATION_ROW, [])
|
|
107
|
-
.component('appengineStageAllocationConfigurationRow', appengineStageAllocationConfigurationRow)
|
|
108
|
-
.component('appengineStageAllocationLabel', appengineStageAllocationLabel);
|