@spinnaker/cloudrun 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/cloudrun.module.d.ts +1 -1
- package/dist/common/ComponentUrlDetails.d.ts +7 -0
- package/dist/common/LoadBalancerMessage.d.ts +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/details/CloudrunInstanceDetails.d.ts +23 -0
- package/dist/loadBalancer/configure/wizard/CloudrunLoadBalancerModal.d.ts +32 -0
- package/dist/loadBalancer/details/CloudrunLoadBalancerActions.d.ts +3 -0
- package/dist/loadBalancer/details/sections.d.ts +7 -0
- package/dist/loadBalancer/details/useCloudrunLoadBalancerDetails.d.ts +4 -0
- package/dist/loadBalancer/index.d.ts +4 -2
- package/dist/loadBalancer/loadBalancerTransformer.d.ts +2 -6
- package/dist/manifest/manifest.service.d.ts +5 -0
- package/dist/manifest/manifestCommandBuilder.service.d.ts +1 -1
- package/dist/pipeline/stages/deployManifest/manifestStatus/DeployStatus.d.ts +1 -0
- package/dist/pipeline/stages/deployManifest/manifestStatus/ManifestDetailsLink.d.ts +6 -3
- package/dist/pipeline/stages/editLoadBalancer/CloudrunEditLoadBalancerExecutionDetails.d.ts +7 -0
- package/dist/pipeline/stages/editLoadBalancer/CloudrunEditLoadBalancerStageConfig.d.ts +30 -0
- package/dist/pipeline/stages/editLoadBalancer/cloudrunEditLoadBalancerStage.d.ts +2 -1
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +4 -6
- package/dist/serverGroup/configure/wizard/BasicSettings.d.ts +5 -2
- package/dist/serverGroup/configure/wizard/serverGroupWizard.d.ts +18 -6
- package/dist/serverGroup/details/CloudrunServerGroupActions.d.ts +6 -0
- package/dist/serverGroup/details/cloudrunServerGroupDetailsGetter.d.ts +3 -0
- package/dist/serverGroup/details/sections.d.ts +5 -0
- package/dist/serverGroup/index.d.ts +3 -1
- package/dist/serverGroup/serverGroupTransformer.service.d.ts +1 -5
- package/package.json +4 -11
- package/src/cloudrun.module.spec.ts +22 -0
- package/src/cloudrun.module.ts +54 -59
- package/src/common/ComponentUrlDetails.tsx +25 -0
- package/src/common/LoadBalancerMessage.tsx +17 -0
- package/src/index.ts +2 -1
- package/src/instance/details/CloudrunInstanceDetails.tsx +164 -0
- package/src/loadBalancer/configure/wizard/CloudrunLoadBalancerModal.spec.tsx +85 -0
- package/src/loadBalancer/configure/wizard/CloudrunLoadBalancerModal.tsx +395 -0
- package/src/loadBalancer/details/CloudrunLoadBalancerActions.tsx +66 -0
- package/src/loadBalancer/details/sections.spec.ts +19 -0
- package/src/loadBalancer/details/sections.tsx +91 -0
- package/src/loadBalancer/details/useCloudrunLoadBalancerDetails.ts +56 -0
- package/src/loadBalancer/index.ts +4 -2
- package/src/loadBalancer/loadBalancerTransformer.ts +3 -13
- package/src/manifest/manifest.service.ts +18 -1
- package/src/manifest/manifestCommandBuilder.service.ts +46 -53
- package/src/pipeline/stages/deployManifest/manifestStatus/DeployStatus.tsx +33 -4
- package/src/pipeline/stages/deployManifest/manifestStatus/ManifestDetailsLink.spec.tsx +35 -0
- package/src/pipeline/stages/deployManifest/manifestStatus/ManifestDetailsLink.tsx +10 -5
- package/src/pipeline/stages/editLoadBalancer/CloudrunEditLoadBalancerExecutionDetails.tsx +70 -0
- package/src/pipeline/stages/editLoadBalancer/CloudrunEditLoadBalancerStageConfig.tsx +245 -0
- package/src/pipeline/stages/editLoadBalancer/cloudrunEditLoadBalancerStage.spec.ts +205 -0
- package/src/pipeline/stages/editLoadBalancer/cloudrunEditLoadBalancerStage.ts +14 -71
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +5 -15
- package/src/serverGroup/configure/wizard/BasicSettings.tsx +10 -8
- package/src/serverGroup/configure/wizard/serverGroupWizard.tsx +59 -15
- package/src/serverGroup/details/CloudrunServerGroupActions.tsx +80 -0
- package/src/serverGroup/details/cloudrunServerGroupDetailsGetter.spec.ts +46 -0
- package/src/serverGroup/details/cloudrunServerGroupDetailsGetter.ts +53 -0
- package/src/serverGroup/details/sections.tsx +60 -0
- package/src/serverGroup/index.ts +3 -1
- package/src/serverGroup/routerConsumers.spec.tsx +152 -0
- package/src/serverGroup/serverGroupTransformer.service.ts +2 -12
- 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/instance/details/details.controller.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/pipeline/pipeline.module.d.ts +0 -1
- package/dist/pipeline/stages/editLoadBalancer/loadBalancerChoice.modal.controller.d.ts +0 -1
- package/dist/serverGroup/details/details.controller.d.ts +0 -1
- package/src/common/componentUrlDetails.component.ts +0 -22
- package/src/common/conditionalDescriptionListItem.component.ts +0 -37
- package/src/common/loadBalancerMessage.component.html +0 -11
- package/src/common/loadBalancerMessage.component.ts +0 -13
- package/src/instance/details/details.controller.ts +0 -84
- package/src/instance/details/details.html +0 -68
- package/src/loadBalancer/configure/wizard/allocationConfigurationRow.component.ts +0 -70
- package/src/loadBalancer/configure/wizard/basicSettings.component.html +0 -44
- package/src/loadBalancer/configure/wizard/basicSettings.component.ts +0 -86
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.html +0 -45
- package/src/loadBalancer/configure/wizard/stageAllocationConfigurationRow.component.ts +0 -84
- package/src/loadBalancer/configure/wizard/wizard.controller.ts +0 -157
- package/src/loadBalancer/configure/wizard/wizard.html +0 -39
- package/src/loadBalancer/configure/wizard/wizard.less +0 -9
- package/src/loadBalancer/details/details.controller.ts +0 -140
- package/src/loadBalancer/details/details.html +0 -89
- package/src/pipeline/pipeline.module.ts +0 -6
- 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 -53
- package/src/serverGroup/details/details.controller.ts +0 -134
- package/src/serverGroup/details/details.html +0 -94
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import type { StateService } from '@uirouter/angularjs';
|
|
2
|
-
import type { IController } from 'angular';
|
|
3
|
-
import { module } from 'angular';
|
|
4
|
-
import type { IModalServiceInstance } from 'angular-ui-bootstrap';
|
|
5
|
-
import { cloneDeep } from 'lodash';
|
|
6
|
-
|
|
7
|
-
import type { Application } from '@spinnaker/core';
|
|
8
|
-
import { LoadBalancerWriter, TaskMonitor } from '@spinnaker/core';
|
|
9
|
-
|
|
10
|
-
import type { CloudrunLoadBalancerTransformer, ICloudrunTrafficSplitDescription } from '../../loadBalancerTransformer';
|
|
11
|
-
import { CloudrunLoadBalancerUpsertDescription } from '../../loadBalancerTransformer';
|
|
12
|
-
|
|
13
|
-
import './wizard.less';
|
|
14
|
-
|
|
15
|
-
class CloudrunLoadBalancerWizardController implements IController {
|
|
16
|
-
public state = { loading: true };
|
|
17
|
-
public loadBalancer: CloudrunLoadBalancerUpsertDescription;
|
|
18
|
-
public heading: string;
|
|
19
|
-
public submitButtonLabel: string;
|
|
20
|
-
public taskMonitor: TaskMonitor;
|
|
21
|
-
|
|
22
|
-
public static $inject = [
|
|
23
|
-
'$scope',
|
|
24
|
-
'$state',
|
|
25
|
-
'$uibModalInstance',
|
|
26
|
-
'application',
|
|
27
|
-
'loadBalancer',
|
|
28
|
-
'isNew',
|
|
29
|
-
'forPipelineConfig',
|
|
30
|
-
'cloudrunLoadBalancerTransformer',
|
|
31
|
-
'wizardSubFormValidation',
|
|
32
|
-
];
|
|
33
|
-
constructor(
|
|
34
|
-
public $scope: ng.IScope,
|
|
35
|
-
private $state: StateService,
|
|
36
|
-
private $uibModalInstance: IModalServiceInstance,
|
|
37
|
-
private application: Application,
|
|
38
|
-
loadBalancer: CloudrunLoadBalancerUpsertDescription,
|
|
39
|
-
public isNew: boolean,
|
|
40
|
-
private forPipelineConfig: boolean,
|
|
41
|
-
private cloudrunLoadBalancerTransformer: CloudrunLoadBalancerTransformer,
|
|
42
|
-
private wizardSubFormValidation: any,
|
|
43
|
-
) {
|
|
44
|
-
this.submitButtonLabel = this.forPipelineConfig ? 'Done' : 'Update';
|
|
45
|
-
|
|
46
|
-
if (this.isNew) {
|
|
47
|
-
this.heading = 'Create New Load Balancer';
|
|
48
|
-
} else {
|
|
49
|
-
this.heading = `Edit ${[
|
|
50
|
-
loadBalancer.name,
|
|
51
|
-
loadBalancer.region,
|
|
52
|
-
loadBalancer.account || loadBalancer.credentials,
|
|
53
|
-
].join(':')}`;
|
|
54
|
-
this.cloudrunLoadBalancerTransformer
|
|
55
|
-
.convertLoadBalancerForEditing(loadBalancer, application)
|
|
56
|
-
.then((convertedLoadBalancer) => {
|
|
57
|
-
this.loadBalancer = this.cloudrunLoadBalancerTransformer.convertLoadBalancerToUpsertDescription(
|
|
58
|
-
convertedLoadBalancer,
|
|
59
|
-
);
|
|
60
|
-
if (loadBalancer.split && !this.loadBalancer.splitDescription) {
|
|
61
|
-
this.loadBalancer.splitDescription = CloudrunLoadBalancerUpsertDescription.convertTrafficSplitToTrafficSplitDescription(
|
|
62
|
-
loadBalancer.split,
|
|
63
|
-
);
|
|
64
|
-
} else {
|
|
65
|
-
this.loadBalancer.splitDescription = loadBalancer.splitDescription;
|
|
66
|
-
}
|
|
67
|
-
this.loadBalancer.mapAllocationsToPercentages();
|
|
68
|
-
this.setTaskMonitor();
|
|
69
|
-
this.initializeFormValidation();
|
|
70
|
-
this.state.loading = false;
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public submit(): any {
|
|
76
|
-
const description = cloneDeep(this.loadBalancer);
|
|
77
|
-
description.mapAllocationsToPercentages();
|
|
78
|
-
delete description.serverGroups;
|
|
79
|
-
|
|
80
|
-
if (this.forPipelineConfig) {
|
|
81
|
-
return this.$uibModalInstance.close(description);
|
|
82
|
-
} else {
|
|
83
|
-
return this.taskMonitor.submit(() => {
|
|
84
|
-
return LoadBalancerWriter.upsertLoadBalancer(description, this.application, 'Update');
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public cancel(): void {
|
|
90
|
-
this.$uibModalInstance.dismiss();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public showSubmitButton(): boolean {
|
|
94
|
-
return this.wizardSubFormValidation.subFormsAreValid();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
private setTaskMonitor(): void {
|
|
98
|
-
this.taskMonitor = new TaskMonitor({
|
|
99
|
-
application: this.application,
|
|
100
|
-
title: 'Updating your load balancer',
|
|
101
|
-
modalInstance: this.$uibModalInstance,
|
|
102
|
-
onTaskComplete: () => this.onTaskComplete(),
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
private initializeFormValidation(): void {
|
|
107
|
-
this.wizardSubFormValidation.config({ form: 'form', scope: this.$scope }).register({
|
|
108
|
-
page: 'basic-settings',
|
|
109
|
-
subForm: 'basicSettingsForm',
|
|
110
|
-
validators: [
|
|
111
|
-
{
|
|
112
|
-
watchString: 'ctrl.loadBalancer.splitDescription',
|
|
113
|
-
validator: (splitDescription: ICloudrunTrafficSplitDescription): boolean => {
|
|
114
|
-
return (
|
|
115
|
-
splitDescription.allocationDescriptions.reduce((sum, description) => sum + description.percent, 0) === 100
|
|
116
|
-
);
|
|
117
|
-
},
|
|
118
|
-
watchDeep: true,
|
|
119
|
-
},
|
|
120
|
-
],
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
private onTaskComplete(): void {
|
|
125
|
-
this.application.getDataSource('loadBalancers').refresh();
|
|
126
|
-
this.application.getDataSource('loadBalancers').onNextRefresh(this.$scope, () => this.onApplicationRefresh());
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
private onApplicationRefresh(): void {
|
|
130
|
-
// If the user has already closed the modal, do not navigate to the new details view
|
|
131
|
-
if ((this.$scope as any).$$destroyed) {
|
|
132
|
-
// $$destroyed is not in the ng.IScope interface
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
this.$uibModalInstance.dismiss();
|
|
137
|
-
const newStateParams = {
|
|
138
|
-
name: this.loadBalancer.name,
|
|
139
|
-
accountId: this.loadBalancer.credentials,
|
|
140
|
-
region: this.loadBalancer.region,
|
|
141
|
-
provider: 'cloudrun',
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
if (!this.$state.includes('**.loadBalancerDetails')) {
|
|
145
|
-
this.$state.go('.loadBalancerDetails', newStateParams);
|
|
146
|
-
} else {
|
|
147
|
-
this.$state.go('^.loadBalancerDetails', newStateParams);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export const CLOUDRUN_LOAD_BALANCER_WIZARD_CTRL = 'spinnaker.cloudrun.loadBalancer.wizard.controller';
|
|
153
|
-
|
|
154
|
-
module(CLOUDRUN_LOAD_BALANCER_WIZARD_CTRL, []).controller(
|
|
155
|
-
'cloudrunLoadBalancerWizardCtrl',
|
|
156
|
-
CloudrunLoadBalancerWizardController,
|
|
157
|
-
);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<form name="form">
|
|
2
|
-
<div ng-if="ctrl.state.loading && !ctrl.isNew" style="height: 200px" class="horizontal center middle">
|
|
3
|
-
<loading-spinner size="'small'"></loading-spinner>
|
|
4
|
-
</div>
|
|
5
|
-
<v2-modal-wizard
|
|
6
|
-
heading="{{::ctrl.heading}}"
|
|
7
|
-
task-monitor="ctrl.taskMonitor"
|
|
8
|
-
dismiss="$dismiss()"
|
|
9
|
-
ng-if="!ctrl.state.loading || ctrl.isNew"
|
|
10
|
-
>
|
|
11
|
-
<div ng-if="!ctrl.isNew">
|
|
12
|
-
<v2-wizard-page key="basic-settings" label="Basic Settings" mark-complete-on-view="false">
|
|
13
|
-
<cloudrun-load-balancer-basic-settings
|
|
14
|
-
load-balancer="ctrl.loadBalancer"
|
|
15
|
-
application="ctrl.application"
|
|
16
|
-
for-pipeline-config="ctrl.forPipelineConfig"
|
|
17
|
-
></cloudrun-load-balancer-basic-settings>
|
|
18
|
-
</v2-wizard-page>
|
|
19
|
-
</div>
|
|
20
|
-
</v2-modal-wizard>
|
|
21
|
-
<cloudrun-load-balancer-message
|
|
22
|
-
ng-if="ctrl.isNew"
|
|
23
|
-
column-offset="1"
|
|
24
|
-
columns="10"
|
|
25
|
-
show-create-message="true"
|
|
26
|
-
></cloudrun-load-balancer-message>
|
|
27
|
-
<div class="modal-footer">
|
|
28
|
-
<button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
|
|
29
|
-
<submit-button
|
|
30
|
-
ng-if="!ctrl.isNew && ctrl.showSubmitButton()"
|
|
31
|
-
label="ctrl.submitButtonLabel"
|
|
32
|
-
is-disabled="cloudrunLoadBalancerForm.$invalid || ctrl.taskMonitor.submitting || ctrl.state.loading"
|
|
33
|
-
submitting="ctrl.taskMonitor.submitting"
|
|
34
|
-
on-click="ctrl.submit()"
|
|
35
|
-
is-new="ctrl.isNew"
|
|
36
|
-
>
|
|
37
|
-
</submit-button>
|
|
38
|
-
</div>
|
|
39
|
-
</form>
|
|
@@ -1,140 +0,0 @@
|
|
|
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
|
-
import { cloneDeep } from 'lodash';
|
|
6
|
-
|
|
7
|
-
import type { Application, ILoadBalancer, ILoadBalancerDeleteCommand } from '@spinnaker/core';
|
|
8
|
-
import { ConfirmationModalService, LoadBalancerWriter } from '@spinnaker/core';
|
|
9
|
-
import type { ICloudrunLoadBalancer } from '../../common/domain/index';
|
|
10
|
-
|
|
11
|
-
interface ILoadBalancerFromStateParams {
|
|
12
|
-
accountId: string;
|
|
13
|
-
region: string;
|
|
14
|
-
name: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
class CloudrunLoadBalancerDetailsController implements IController {
|
|
18
|
-
public state = { loading: true };
|
|
19
|
-
private loadBalancerFromParams: ILoadBalancerFromStateParams;
|
|
20
|
-
public loadBalancer: ICloudrunLoadBalancer;
|
|
21
|
-
|
|
22
|
-
public static $inject = ['$uibModal', '$state', '$scope', 'loadBalancer', 'app'];
|
|
23
|
-
constructor(
|
|
24
|
-
private $uibModal: IModalService,
|
|
25
|
-
private $state: StateService,
|
|
26
|
-
private $scope: IScope,
|
|
27
|
-
loadBalancer: ILoadBalancerFromStateParams,
|
|
28
|
-
private app: Application,
|
|
29
|
-
) {
|
|
30
|
-
this.loadBalancerFromParams = loadBalancer;
|
|
31
|
-
this.app
|
|
32
|
-
.getDataSource('loadBalancers')
|
|
33
|
-
.ready()
|
|
34
|
-
.then(() => this.extractLoadBalancer());
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// edit loadbalancer to change traffic
|
|
38
|
-
|
|
39
|
-
public editLoadBalancer(): void {
|
|
40
|
-
this.$uibModal.open({
|
|
41
|
-
templateUrl: require('../configure/wizard/wizard.html'),
|
|
42
|
-
controller: 'cloudrunLoadBalancerWizardCtrl as ctrl',
|
|
43
|
-
size: 'lg',
|
|
44
|
-
resolve: {
|
|
45
|
-
application: () => this.app,
|
|
46
|
-
loadBalancer: () => cloneDeep(this.loadBalancer),
|
|
47
|
-
isNew: () => false,
|
|
48
|
-
forPipelineConfig: () => false,
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
private extractLoadBalancer(): void {
|
|
54
|
-
this.loadBalancer = this.app.getDataSource('loadBalancers').data.find((test: ILoadBalancer) => {
|
|
55
|
-
return test.name === this.loadBalancerFromParams.name && test.account === this.loadBalancerFromParams.accountId;
|
|
56
|
-
}) as ICloudrunLoadBalancer;
|
|
57
|
-
|
|
58
|
-
if (this.loadBalancer) {
|
|
59
|
-
this.state.loading = false;
|
|
60
|
-
this.app.getDataSource('loadBalancers').onRefresh(this.$scope, () => this.extractLoadBalancer());
|
|
61
|
-
} else {
|
|
62
|
-
this.autoClose();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public deleteLoadBalancer(): void {
|
|
67
|
-
const taskMonitor = {
|
|
68
|
-
application: this.app,
|
|
69
|
-
title: 'Deleting ' + this.loadBalancer.name,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const submitMethod = () => {
|
|
73
|
-
const loadBalancer: ILoadBalancerDeleteCommand = {
|
|
74
|
-
cloudProvider: this.loadBalancer.cloudProvider,
|
|
75
|
-
loadBalancerName: this.loadBalancer.name,
|
|
76
|
-
credentials: this.loadBalancer.account,
|
|
77
|
-
};
|
|
78
|
-
return LoadBalancerWriter.deleteLoadBalancer(loadBalancer, this.app);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
ConfirmationModalService.confirm({
|
|
82
|
-
header: 'Really delete ' + this.loadBalancer.name + '?',
|
|
83
|
-
buttonText: 'Delete ' + this.loadBalancer.name,
|
|
84
|
-
body: this.getConfirmationModalBodyHtml(),
|
|
85
|
-
account: this.loadBalancer.account,
|
|
86
|
-
taskMonitorConfig: taskMonitor,
|
|
87
|
-
submitMethod,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public canDeleteLoadBalancer(): boolean {
|
|
92
|
-
return this.loadBalancer.name !== 'default';
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private getConfirmationModalBodyHtml(): string {
|
|
96
|
-
const serverGroupNames = this.loadBalancer.serverGroups.map((serverGroup) => serverGroup.name);
|
|
97
|
-
const hasAny = serverGroupNames ? serverGroupNames.length > 0 : false;
|
|
98
|
-
const hasMoreThanOne = serverGroupNames ? serverGroupNames.length > 1 : false;
|
|
99
|
-
|
|
100
|
-
// HTML accepted by the confirmationModalService is static (i.e., not managed by angular).
|
|
101
|
-
if (hasAny) {
|
|
102
|
-
if (hasMoreThanOne) {
|
|
103
|
-
const listOfServerGroupNames = serverGroupNames.map((name) => `<li>${name}</li>`).join('');
|
|
104
|
-
return `<div class="alert alert-warning">
|
|
105
|
-
<p>
|
|
106
|
-
Deleting <b>${this.loadBalancer.name}</b> will destroy the following server groups:
|
|
107
|
-
<ul>
|
|
108
|
-
${listOfServerGroupNames}
|
|
109
|
-
</ul>
|
|
110
|
-
</p>
|
|
111
|
-
</div>
|
|
112
|
-
`;
|
|
113
|
-
} else {
|
|
114
|
-
return `<div class="alert alert-warning">
|
|
115
|
-
<p>
|
|
116
|
-
Deleting <b>${this.loadBalancer.name}</b> will destroy <b>${serverGroupNames[0]}</b>.
|
|
117
|
-
</p>
|
|
118
|
-
</div>
|
|
119
|
-
`;
|
|
120
|
-
}
|
|
121
|
-
} else {
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
private autoClose(): void {
|
|
127
|
-
if (this.$scope.$$destroyed) {
|
|
128
|
-
return;
|
|
129
|
-
} else {
|
|
130
|
-
this.$state.params.allowModalToStayOpen = true;
|
|
131
|
-
this.$state.go('^', null, { location: 'replace' });
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export const CLOUDRUN_LOAD_BALANCER_DETAILS_CTRL = 'spinnaker.cloudrun.loadBalancerDetails.controller';
|
|
137
|
-
module(CLOUDRUN_LOAD_BALANCER_DETAILS_CTRL, []).controller(
|
|
138
|
-
'cloudrunLoadBalancerDetailsCtrl',
|
|
139
|
-
CloudrunLoadBalancerDetailsController,
|
|
140
|
-
);
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<div class="details-panel">
|
|
2
|
-
<div ng-if="ctrl.state.loading" class="header">
|
|
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
|
-
<div class="horizontal center middle">
|
|
9
|
-
<loading-spinner size="'small'"></loading-spinner>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<div ng-if="!ctrl.state.loading" class="header">
|
|
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
|
-
<i class="fa icon-sitemap"></i>
|
|
21
|
-
<h3 class="horizontal middle space-between flex-1" select-on-dbl-click>{{ctrl.loadBalancer.name}}</h3>
|
|
22
|
-
</div>
|
|
23
|
-
<div>
|
|
24
|
-
<div class="actions">
|
|
25
|
-
<div class="dropdown" uib-dropdown dropdown-append-to-body>
|
|
26
|
-
<button type="button" class="btn btn-sm btn-primary dropdown-toggle" uib-dropdown-toggle>
|
|
27
|
-
Load Balancer Actions <span class="caret"></span>
|
|
28
|
-
</button>
|
|
29
|
-
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
|
|
30
|
-
<li><a href ng-click="ctrl.editLoadBalancer()">Edit Load Balancer</a></li>
|
|
31
|
-
<li ng-if="ctrl.canDeleteLoadBalancer()">
|
|
32
|
-
<a href ng-click="ctrl.deleteLoadBalancer()">Delete Load Balancer</a>
|
|
33
|
-
</li>
|
|
34
|
-
<li
|
|
35
|
-
ng-if="!ctrl.canDeleteLoadBalancer()"
|
|
36
|
-
uib-tooltip="You cannot delete a default service."
|
|
37
|
-
class="disabled"
|
|
38
|
-
>
|
|
39
|
-
<a href>Delete Load Balancer</a>
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
|
|
47
|
-
<div ng-if="!ctrl.state.loading" class="content">
|
|
48
|
-
<collapsible-section heading="Load Balancer Details" expanded="true">
|
|
49
|
-
<dl class="dl-horizontal dl-narrow">
|
|
50
|
-
<dt>In</dt>
|
|
51
|
-
<dd><account-tag account="ctrl.loadBalancer.account" pad="right"></account-tag></dd>
|
|
52
|
-
<dt>Region</dt>
|
|
53
|
-
<dd>{{ctrl.loadBalancer.region}}</dd>
|
|
54
|
-
<dt ng-if="ctrl.loadBalancer.serverGroups.length">Server Groups</dt>
|
|
55
|
-
<dd ng-if="ctrl.loadBalancer.serverGroups.length">
|
|
56
|
-
<ul>
|
|
57
|
-
<li ng-repeat="serverGroup in ctrl.loadBalancer.serverGroups | orderBy: ['isDisabled', '-name']">
|
|
58
|
-
<a
|
|
59
|
-
ui-sref="^.serverGroup({region: serverGroup.region,
|
|
60
|
-
accountId: serverGroup.account,
|
|
61
|
-
serverGroup: serverGroup.name,
|
|
62
|
-
provider: 'cloudrun'})"
|
|
63
|
-
>
|
|
64
|
-
{{serverGroup.name}}
|
|
65
|
-
</a>
|
|
66
|
-
</li>
|
|
67
|
-
</ul>
|
|
68
|
-
</dd>
|
|
69
|
-
</dl>
|
|
70
|
-
</collapsible-section>
|
|
71
|
-
<collapsible-section heading="Status" expanded="true">
|
|
72
|
-
<health-counts class="pull-left" container="ctrl.loadBalancer.instanceCounts"></health-counts>
|
|
73
|
-
</collapsible-section>
|
|
74
|
-
<collapsible-section heading="Traffic Split" expanded="true">
|
|
75
|
-
<dl class="dl-horizontal dl-narrow">
|
|
76
|
-
<ul>
|
|
77
|
-
<li ng-repeat="trafficTarget in ctrl.loadBalancer.split.trafficTargets">
|
|
78
|
-
{{trafficTarget.revisionName}}:<span class="pull-right">{{trafficTarget.percent}}</span>
|
|
79
|
-
</li>
|
|
80
|
-
</ul>
|
|
81
|
-
</dl>
|
|
82
|
-
</collapsible-section>
|
|
83
|
-
<collapsible-section heading="DNS" expanded="true">
|
|
84
|
-
<dl class="dl-narrow">
|
|
85
|
-
<cloudrun-component-url-details component="ctrl.loadBalancer"></cloudrun-component-url-details>
|
|
86
|
-
</dl>
|
|
87
|
-
</collapsible-section>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { module } from 'angular';
|
|
2
|
-
|
|
3
|
-
import { CLOUDRUN_EDIT_LOAD_BALANCER_STAGE } from './stages/editLoadBalancer/cloudrunEditLoadBalancerStage';
|
|
4
|
-
|
|
5
|
-
export const CLOUDRUN_PIPELINE_MODULE = 'spinnaker.cloudrun.pipeline.module';
|
|
6
|
-
module(CLOUDRUN_PIPELINE_MODULE, [CLOUDRUN_EDIT_LOAD_BALANCER_STAGE]);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<div ng-controller="BaseExecutionDetailsCtrl">
|
|
2
|
-
<execution-details-section-nav sections="configSections"></execution-details-section-nav>
|
|
3
|
-
<div class="step-section-details" ng-if="detailsSection === 'editLoadBalancerConfig'">
|
|
4
|
-
<div class="row">
|
|
5
|
-
<div class="col-md-12">
|
|
6
|
-
<table class="table table-condensed">
|
|
7
|
-
<thead>
|
|
8
|
-
<tr>
|
|
9
|
-
<th>Account</th>
|
|
10
|
-
<th>Name</th>
|
|
11
|
-
<th>Region</th>
|
|
12
|
-
</tr>
|
|
13
|
-
</thead>
|
|
14
|
-
<tbody>
|
|
15
|
-
<tr ng-repeat="loadBalancer in stage.context.loadBalancers">
|
|
16
|
-
<td>
|
|
17
|
-
<account-tag account="loadBalancer.credentials"></account-tag>
|
|
18
|
-
</td>
|
|
19
|
-
<td>{{ loadBalancer.name }}</td>
|
|
20
|
-
<td>{{ loadBalancer.region }}</td>
|
|
21
|
-
</tr>
|
|
22
|
-
</tbody>
|
|
23
|
-
</table>
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
<stage-failure-message stage="stage" message="stage.failureMessage"></stage-failure-message>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="step-section-details" ng-if="detailsSection === 'taskStatus'">
|
|
29
|
-
<div class="row">
|
|
30
|
-
<execution-step-details item="stage"></execution-step-details>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<div class="well well-sm clearfix" ng-if="!pipeline.strategy">
|
|
2
|
-
<div class="row">
|
|
3
|
-
<div class="col-md-12">
|
|
4
|
-
<h4 class="text-left">Load Balancers</h4>
|
|
5
|
-
</div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="row">
|
|
8
|
-
<div class="col-md-12">
|
|
9
|
-
<table class="table table-condensed">
|
|
10
|
-
<thead>
|
|
11
|
-
<tr>
|
|
12
|
-
<th>Account</th>
|
|
13
|
-
<th>Name</th>
|
|
14
|
-
<th>Region</th>
|
|
15
|
-
<th>Actions</th>
|
|
16
|
-
</tr>
|
|
17
|
-
</thead>
|
|
18
|
-
<tbody>
|
|
19
|
-
<tr ng-repeat="loadBalancer in stage.loadBalancers">
|
|
20
|
-
<td>
|
|
21
|
-
<account-tag account="loadBalancer.credentials"></account-tag>
|
|
22
|
-
</td>
|
|
23
|
-
<td>{{ loadBalancer.name }}</td>
|
|
24
|
-
<td>{{ loadBalancer.region }}</td>
|
|
25
|
-
<td class="condensed-actions">
|
|
26
|
-
<a class="btn btn-sm btn-link" href ng-click="editLoadBalancerStageCtrl.editLoadBalancer($index)">
|
|
27
|
-
<span class="glyphicon glyphicon-edit" uib-tooltip="Edit"></span
|
|
28
|
-
></a>
|
|
29
|
-
<a
|
|
30
|
-
class="btn btn-sm btn-link pad-left"
|
|
31
|
-
href
|
|
32
|
-
ng-click="editLoadBalancerStageCtrl.removeLoadBalancer($index)"
|
|
33
|
-
>
|
|
34
|
-
<span class="glyphicon glyphicon-trash" uib-tooltip="Remove"></span>
|
|
35
|
-
</a>
|
|
36
|
-
</td>
|
|
37
|
-
</tr>
|
|
38
|
-
</tbody>
|
|
39
|
-
<tfoot>
|
|
40
|
-
<tr>
|
|
41
|
-
<td colspan="8">
|
|
42
|
-
<button class="btn btn-block btn-sm add-new" ng-click="editLoadBalancerStageCtrl.addLoadBalancer()">
|
|
43
|
-
<span class="glyphicon glyphicon-plus-sign"></span> Add load balancer
|
|
44
|
-
</button>
|
|
45
|
-
</td>
|
|
46
|
-
</tr>
|
|
47
|
-
</tfoot>
|
|
48
|
-
</table>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { IController } from 'angular';
|
|
2
|
-
import { module } from 'angular';
|
|
3
|
-
import type { IModalService, IModalServiceInstance } from 'angular-ui-bootstrap';
|
|
4
|
-
import { cloneDeep } from 'lodash';
|
|
5
|
-
|
|
6
|
-
import type { Application, ILoadBalancer } from '@spinnaker/core';
|
|
7
|
-
import { CloudProviderRegistry } from '@spinnaker/core';
|
|
8
|
-
|
|
9
|
-
class CloudrunLoadBalancerChoiceModalCtrl implements IController {
|
|
10
|
-
public state = { loading: true };
|
|
11
|
-
public loadBalancers: ILoadBalancer[];
|
|
12
|
-
public selectedLoadBalancer: ILoadBalancer;
|
|
13
|
-
|
|
14
|
-
public static $inject = ['$uibModal', '$uibModalInstance', 'application'];
|
|
15
|
-
constructor(
|
|
16
|
-
private $uibModal: IModalService,
|
|
17
|
-
private $uibModalInstance: IModalServiceInstance,
|
|
18
|
-
private application: Application,
|
|
19
|
-
) {
|
|
20
|
-
this.initialize();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public submit(): void {
|
|
24
|
-
const config = CloudProviderRegistry.getValue('cloudrun', 'loadBalancer');
|
|
25
|
-
const updatedLoadBalancerPromise = this.$uibModal.open({
|
|
26
|
-
templateUrl: config.createLoadBalancerTemplateUrl,
|
|
27
|
-
controller: `${config.createLoadBalancerController} as ctrl`,
|
|
28
|
-
size: 'lg',
|
|
29
|
-
resolve: {
|
|
30
|
-
application: () => this.application,
|
|
31
|
-
loadBalancer: () => cloneDeep(this.selectedLoadBalancer),
|
|
32
|
-
isNew: () => false,
|
|
33
|
-
forPipelineConfig: () => true,
|
|
34
|
-
},
|
|
35
|
-
}).result;
|
|
36
|
-
|
|
37
|
-
this.$uibModalInstance.close(updatedLoadBalancerPromise);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public cancel(): void {
|
|
41
|
-
this.$uibModalInstance.dismiss();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
private initialize(): void {
|
|
45
|
-
this.application
|
|
46
|
-
.getDataSource('loadBalancers')
|
|
47
|
-
.ready()
|
|
48
|
-
.then(() => {
|
|
49
|
-
this.loadBalancers = (this.application.loadBalancers.data as ILoadBalancer[]).filter(
|
|
50
|
-
(candidate) => candidate.cloudProvider === 'cloudrun',
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
if (this.loadBalancers.length) {
|
|
54
|
-
this.selectedLoadBalancer = this.loadBalancers[0];
|
|
55
|
-
}
|
|
56
|
-
this.state.loading = false;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const CLOUDRUN_LOAD_BALANCER_CHOICE_MODAL_CTRL = 'spinnaker.Cloudrun.loadBalancerChoiceModal.controller';
|
|
62
|
-
module(CLOUDRUN_LOAD_BALANCER_CHOICE_MODAL_CTRL, []).controller(
|
|
63
|
-
'cloudrunLoadBalancerChoiceModelCtrl',
|
|
64
|
-
CloudrunLoadBalancerChoiceModalCtrl,
|
|
65
|
-
);
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<div modal-page>
|
|
2
|
-
<modal-close dismiss="$dismiss()"></modal-close>
|
|
3
|
-
<div class="modal-header">
|
|
4
|
-
<h4 class="modal-title">Select Load Balancer</h4>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="modal-body" ng-if="ctrl.state.loading" style="height: 200px" class="horizontal center middle">
|
|
7
|
-
<loading-spinner size="'small'"></loading-spinner>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="modal-body" ng-if="!ctrl.state.loading">
|
|
10
|
-
<div class="alert alert-warning" ng-if="ctrl.loadBalancers.length === 0">
|
|
11
|
-
<p>
|
|
12
|
-
Spinnaker cannot create a load balancer for Cloud Run. A Spinnaker load balancer maps to a Cloud Run service
|
|
13
|
-
which along with a Revision are created from Create Server Group page using a
|
|
14
|
-
</p>
|
|
15
|
-
<p><code>yaml file</code> <help-field key="cloudrun.serverGroup.file"></help-field></p>
|
|
16
|
-
<p>
|
|
17
|
-
If a service does not exist when a Revision is deployed, it will be created. It will then be editable as a load
|
|
18
|
-
balancer within Spinnaker.
|
|
19
|
-
</p>
|
|
20
|
-
</div>
|
|
21
|
-
<form
|
|
22
|
-
role="form"
|
|
23
|
-
name="form"
|
|
24
|
-
class="form-horizontal"
|
|
25
|
-
ng-submit="ctrl.submit()"
|
|
26
|
-
ng-if="ctrl.loadBalancers.length > 0"
|
|
27
|
-
>
|
|
28
|
-
<div class="form-group">
|
|
29
|
-
<div class="col-md-3 sm-label-right">
|
|
30
|
-
<b>Load Balancer</b>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="col-md-7">
|
|
33
|
-
<ui-select class="form-control input-sm" ng-model="ctrl.selectedLoadBalancer">
|
|
34
|
-
<ui-select-match>
|
|
35
|
-
<account-tag account="$select.selected.account"></account-tag>
|
|
36
|
-
<span style="margin-left: 5px">{{$select.selected.name}}</span>
|
|
37
|
-
</ui-select-match>
|
|
38
|
-
<ui-select-choices repeat="loadBalancer in ctrl.loadBalancers | filter: $select.search">
|
|
39
|
-
<account-tag account="loadBalancer.account"></account-tag>
|
|
40
|
-
<span style="margin-left: 5px" ng-bind-html="loadBalancer.name"></span>
|
|
41
|
-
</ui-select-choices>
|
|
42
|
-
</ui-select>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</form>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="modal-footer">
|
|
48
|
-
<button class="btn btn-default" ng-click="ctrl.cancel()">Cancel</button>
|
|
49
|
-
<button class="btn btn-primary" ng-if="ctrl.loadBalancers.length > 0" ng-click="ctrl.submit()">
|
|
50
|
-
<span class="far fa-check-circle"></span> Edit
|
|
51
|
-
</button>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|