@spinnaker/azure 2026.2.2 → 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/azure.module.d.ts +3 -1
- package/dist/image/image.reader.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/azureInstanceType.service.d.ts +6 -2
- package/dist/instance/details/AzureInstanceDetails.d.ts +67 -0
- package/dist/loadBalancer/configure/AzureLoadBalancerChoiceModal.d.ts +10 -5
- package/dist/loadBalancer/configure/AzureLoadBalancerModal.d.ts +102 -0
- package/dist/loadBalancer/details/azureLoadBalancerDetails.d.ts +26 -0
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +45 -2
- package/dist/pipeline/stages/AzureAccountRegionClusterSelector.d.ts +32 -0
- package/dist/pipeline/stages/bake/azureBakeStage.d.ts +46 -2
- package/dist/pipeline/stages/destroyAsg/azureDestroyAsgStage.d.ts +14 -2
- package/dist/pipeline/stages/disableAsg/azureDisableAsgStage.d.ts +4 -2
- package/dist/pipeline/stages/enableAsg/azureEnableAsgStage.d.ts +4 -2
- package/dist/securityGroup/configure/AzureSecurityGroupModal.d.ts +70 -0
- package/dist/securityGroup/details/AzureSecurityGroupDetails.d.ts +51 -0
- package/dist/securityGroup/securityGroup.reader.d.ts +3 -2
- package/dist/securityGroup/securityGroup.transformer.d.ts +3 -2
- package/dist/securityGroup/securityGroup.write.service.d.ts +9 -2
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +88 -2
- package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +30 -2
- package/dist/serverGroup/configure/wizard/AzureCloneServerGroupModal.d.ts +44 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupAdvancedSettings.d.ts +8 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +12 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupCapacityAndZones.d.ts +11 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupHealthSettings.d.ts +10 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupImageSettings.d.ts +12 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupInstanceType.d.ts +9 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.d.ts +14 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupNetworkSettings.d.ts +10 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupSecurityGroups.d.ts +6 -0
- package/dist/serverGroup/configure/wizard/pages/ServerGroupTags.d.ts +9 -0
- package/dist/serverGroup/configure/wizard/pages/common.d.ts +14 -0
- package/dist/serverGroup/configure/wizard/pages/index.d.ts +10 -0
- package/dist/serverGroup/details/azureServerGroupDetails.d.ts +13 -0
- package/dist/serverGroup/details/rollback/RollbackServerGroupModal.d.ts +6 -4
- package/dist/serverGroup/serverGroup.transformer.d.ts +61 -2
- package/dist/validation/applicationName.validator.d.ts +6 -2
- package/package.json +5 -8
- package/src/azure.module.spec.ts +921 -0
- package/src/azure.module.ts +56 -68
- package/src/image/image.reader.js +4 -15
- package/src/image/image.reader.spec.js +4 -7
- package/src/instance/azureInstanceType.service.js +8 -16
- package/src/instance/azureInstanceType.service.spec.js +5 -13
- package/src/instance/details/AzureInstanceDetails.spec.tsx +364 -0
- package/src/instance/details/AzureInstanceDetails.tsx +533 -0
- package/src/loadBalancer/configure/AzureLoadBalancerChoiceModal.spec.tsx +125 -0
- package/src/loadBalancer/configure/AzureLoadBalancerChoiceModal.tsx +46 -26
- package/src/loadBalancer/configure/AzureLoadBalancerModal.spec.tsx +658 -0
- package/src/loadBalancer/configure/AzureLoadBalancerModal.tsx +960 -0
- package/src/loadBalancer/details/azureLoadBalancerDetails.spec.tsx +470 -0
- package/src/loadBalancer/details/azureLoadBalancerDetails.tsx +412 -0
- package/src/loadBalancer/loadBalancer.transformer.js +83 -93
- package/src/pipeline/stages/AzureAccountRegionClusterSelector.tsx +238 -0
- package/src/pipeline/stages/bake/azureBakeStage.tsx +723 -0
- package/src/pipeline/stages/destroyAsg/azureDestroyAsgStage.tsx +128 -0
- package/src/pipeline/stages/disableAsg/azureDisableAsgStage.tsx +92 -0
- package/src/pipeline/stages/enableAsg/azureEnableAsgStage.tsx +87 -0
- package/src/routerConsumers.spec.tsx +69 -0
- package/src/securityGroup/configure/AzureSecurityGroupModal.spec.tsx +558 -0
- package/src/securityGroup/configure/AzureSecurityGroupModal.tsx +782 -0
- package/src/securityGroup/details/AzureSecurityGroupDetails.spec.tsx +291 -0
- package/src/securityGroup/details/AzureSecurityGroupDetails.tsx +354 -0
- package/src/securityGroup/securityGroup.reader.js +3 -13
- package/src/securityGroup/securityGroup.transformer.js +3 -13
- package/src/securityGroup/securityGroup.write.service.spec.ts +105 -0
- package/src/securityGroup/securityGroup.write.service.ts +73 -0
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.js +167 -166
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.spec.js +63 -0
- package/src/serverGroup/configure/serverGroupConfiguration.service.js +325 -309
- package/src/serverGroup/configure/serverGroupConfiguration.service.spec.js +57 -53
- package/src/serverGroup/configure/wizard/AzureCloneServerGroupModal.spec.tsx +758 -0
- package/src/serverGroup/configure/wizard/AzureCloneServerGroupModal.tsx +349 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupAdvancedSettings.tsx +208 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.tsx +122 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupCapacityAndZones.tsx +80 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupHealthSettings.tsx +97 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupImageSettings.tsx +151 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupInstanceType.tsx +41 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.tsx +214 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupNetworkSettings.tsx +119 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupSecurityGroups.tsx +54 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupTags.tsx +40 -0
- package/src/serverGroup/configure/wizard/pages/common.tsx +72 -0
- package/src/serverGroup/configure/wizard/pages/index.ts +10 -0
- package/src/serverGroup/details/azureServerGroupDetails.spec.tsx +263 -0
- package/src/serverGroup/details/azureServerGroupDetails.tsx +318 -0
- package/src/serverGroup/details/rollback/RollbackServerGroupModal.tsx +24 -30
- package/src/serverGroup/serverGroup.transformer.js +11 -19
- package/src/serverGroup/serverGroup.transformer.spec.js +2 -6
- package/src/validation/applicationName.validator.js +14 -29
- package/dist/instance/details/instance.details.controller.d.ts +0 -2
- package/dist/loadBalancer/configure/createLoadBalancer.controller.d.ts +0 -2
- package/dist/loadBalancer/details/loadBalancerDetail.controller.d.ts +0 -2
- package/dist/pipeline/stages/bake/bakeExecutionDetails.controller.d.ts +0 -2
- package/dist/securityGroup/clone/cloneSecurityGroup.controller.d.ts +0 -2
- package/dist/securityGroup/configure/CreateSecurityGroupCtrl.d.ts +0 -2
- package/dist/securityGroup/configure/EditSecurityGroupCtrl.d.ts +0 -2
- package/dist/securityGroup/details/securityGroupDetail.controller.d.ts +0 -2
- package/dist/serverGroup/configure/serverGroup.configure.azure.module.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/CloneServerGroup.azure.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/ServerGroupInstanceArchetype.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/ServerGroupInstanceType.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/advancedSettings/ServerGroupAdvancedSettings.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/basicSettings/ServerGroupBasicSettings.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/basicSettings/image.regional.filter.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/capacity/capacitySelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/healthSettings/ServerGroupHealthSettings.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/image/imageSettingsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/loadBalancers/ServerGroupLoadBalancers.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettings.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/securityGroup/ServerGroupSecurityGroups.controller.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/tags/tagsSelector.directive.d.ts +0 -2
- package/dist/serverGroup/configure/wizard/zones/zoneSelector.directive.d.ts +0 -2
- package/dist/serverGroup/details/serverGroup.details.module.d.ts +0 -2
- package/dist/serverGroup/details/serverGroupDetails.azure.controller.d.ts +0 -2
- package/src/instance/details/instance.details.controller.js +0 -371
- package/src/instance/details/instance.details.controller.spec.js +0 -129
- package/src/instance/details/instanceDetails.html +0 -43
- package/src/loadBalancer/configure/advancedSettings.html +0 -95
- package/src/loadBalancer/configure/createLoadBalancer.controller.js +0 -275
- package/src/loadBalancer/configure/createLoadBalancer.controller.spec.js +0 -39
- package/src/loadBalancer/configure/createLoadBalancer.html +0 -25
- package/src/loadBalancer/configure/createLoadBalancerProperties.html +0 -128
- package/src/loadBalancer/configure/editLoadBalancer.html +0 -26
- package/src/loadBalancer/configure/healthCheck.html +0 -74
- package/src/loadBalancer/configure/listeners.html +0 -50
- package/src/loadBalancer/details/loadBalancerDetail.controller.js +0 -181
- package/src/loadBalancer/details/loadBalancerDetail.controller.spec.js +0 -39
- package/src/loadBalancer/details/loadBalancerDetail.html +0 -128
- package/src/pipeline/stages/bake/azureBakeStage.js +0 -276
- package/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +0 -40
- package/src/pipeline/stages/bake/bakeExecutionDetails.html +0 -50
- package/src/pipeline/stages/bake/bakeStage.html +0 -187
- package/src/pipeline/stages/destroyAsg/azureDestroyAsgStage.js +0 -73
- package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +0 -9
- package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableAsg/azureDisableAsgStage.js +0 -65
- package/src/pipeline/stages/disableAsg/disableAsgStage.html +0 -11
- package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/enableAsg/azureEnableAsgStage.js +0 -70
- package/src/pipeline/stages/enableAsg/enableAsgStage.html +0 -11
- package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +0 -1
- package/src/securityGroup/clone/cloneSecurityGroup.controller.js +0 -162
- package/src/securityGroup/clone/cloneSecurityGroup.html +0 -8
- package/src/securityGroup/configure/CreateSecurityGroup.controller.spec.js +0 -78
- package/src/securityGroup/configure/CreateSecurityGroupCtrl.js +0 -265
- package/src/securityGroup/configure/EditSecurityGroupCtrl.js +0 -222
- package/src/securityGroup/configure/configSecurityGroup.mixin.controller.js +0 -262
- package/src/securityGroup/configure/createSecurityGroup.html +0 -20
- package/src/securityGroup/configure/createSecurityGroupIngress.html +0 -75
- package/src/securityGroup/configure/createSecurityGroupProperties.html +0 -88
- package/src/securityGroup/configure/editSecurityGroup.html +0 -19
- package/src/securityGroup/details/securityGroupDetail.controller.js +0 -142
- package/src/securityGroup/details/securityGroupDetail.html +0 -78
- package/src/securityGroup/securityGroup.write.service.js +0 -57
- package/src/serverGroup/configure/serverGroup.configure.azure.module.js +0 -47
- package/src/serverGroup/configure/wizard/CloneServerGroup.azure.controller.js +0 -247
- package/src/serverGroup/configure/wizard/ServerGroupInstanceArchetype.controller.js +0 -35
- package/src/serverGroup/configure/wizard/ServerGroupInstanceType.controller.js +0 -15
- package/src/serverGroup/configure/wizard/advancedSettings/ServerGroupAdvancedSettings.controller.js +0 -25
- package/src/serverGroup/configure/wizard/advancedSettings/advancedSettings.html +0 -5
- package/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.html +0 -138
- package/src/serverGroup/configure/wizard/advancedSettings/advancedSettingsSelector.directive.js +0 -43
- package/src/serverGroup/configure/wizard/basicSettings/ServerGroupBasicSettings.controller.js +0 -71
- package/src/serverGroup/configure/wizard/basicSettings/basicSettings.html +0 -131
- package/src/serverGroup/configure/wizard/basicSettings/image.regional.filter.js +0 -15
- package/src/serverGroup/configure/wizard/basicSettings/image.regional.filter.spec.js +0 -42
- package/src/serverGroup/configure/wizard/capacity/capacity.html +0 -5
- package/src/serverGroup/configure/wizard/capacity/capacitySelector.directive.html +0 -20
- package/src/serverGroup/configure/wizard/capacity/capacitySelector.directive.js +0 -21
- package/src/serverGroup/configure/wizard/capacity/zones.html +0 -5
- package/src/serverGroup/configure/wizard/healthSettings/ServerGroupHealthSettings.controller.js +0 -38
- package/src/serverGroup/configure/wizard/healthSettings/healthSettings.html +0 -5
- package/src/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.html +0 -32
- package/src/serverGroup/configure/wizard/healthSettings/healthSettingsSelector.directive.js +0 -22
- package/src/serverGroup/configure/wizard/image/ServerGroupImageSettings.controller.js +0 -34
- package/src/serverGroup/configure/wizard/image/imageSettings.html +0 -5
- package/src/serverGroup/configure/wizard/image/imageSettingsSelector.directive.html +0 -33
- package/src/serverGroup/configure/wizard/image/imageSettingsSelector.directive.js +0 -22
- package/src/serverGroup/configure/wizard/instanceArchetype.html +0 -33
- package/src/serverGroup/configure/wizard/instanceType/instanceType.html +0 -10
- package/src/serverGroup/configure/wizard/instanceType.html +0 -33
- package/src/serverGroup/configure/wizard/loadBalancers/ServerGroupLoadBalancers.controller.js +0 -137
- package/src/serverGroup/configure/wizard/loadBalancers/loadBalancers.html +0 -3
- package/src/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.html +0 -41
- package/src/serverGroup/configure/wizard/loadBalancers/serverGroupLoadBalancersSelector.directive.js +0 -22
- package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettings.controller.js +0 -44
- package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.html +0 -54
- package/src/serverGroup/configure/wizard/networkSettings/ServerGroupNetworkSettingsSelector.directive.js +0 -19
- package/src/serverGroup/configure/wizard/networkSettings/networkSettings.html +0 -3
- package/src/serverGroup/configure/wizard/securityGroup/ServerGroupSecurityGroups.controller.js +0 -28
- package/src/serverGroup/configure/wizard/securityGroup/securityGroups.html +0 -3
- package/src/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.html +0 -40
- package/src/serverGroup/configure/wizard/securityGroup/serverGroupSecurityGroupsSelector.directive.js +0 -38
- package/src/serverGroup/configure/wizard/serverGroupWizard.html +0 -61
- package/src/serverGroup/configure/wizard/tags/tags.html +0 -5
- package/src/serverGroup/configure/wizard/tags/tagsSelector.directive.html +0 -16
- package/src/serverGroup/configure/wizard/tags/tagsSelector.directive.js +0 -30
- package/src/serverGroup/configure/wizard/templateSelection.html +0 -9
- package/src/serverGroup/configure/wizard/zones/zoneSelector.directive.html +0 -21
- package/src/serverGroup/configure/wizard/zones/zoneSelector.directive.js +0 -28
- package/src/serverGroup/details/serverGroup.details.module.js +0 -11
- package/src/serverGroup/details/serverGroupDetails.azure.controller.js +0 -260
- package/src/serverGroup/details/serverGroupDetails.html +0 -98
- package/src/subnet/subnetSelectField.directive.html +0 -28
- package/src/subnet/subnetSelectField.directive.js +0 -35
package/src/azure.module.ts
CHANGED
|
@@ -1,95 +1,83 @@
|
|
|
1
|
-
import { module } from 'angular';
|
|
2
|
-
|
|
3
1
|
import { CloudProviderRegistry, DeploymentStrategyRegistry } from '@spinnaker/core';
|
|
4
2
|
|
|
5
3
|
import './help/azure.help';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { AzureImageReader } from './image/image.reader';
|
|
5
|
+
import { AzureInstanceTypeService } from './instance/azureInstanceType.service';
|
|
6
|
+
import { AzureInstanceDetails } from './instance/details/AzureInstanceDetails';
|
|
9
7
|
import { AzureLoadBalancerChoiceModal } from './loadBalancer/configure/AzureLoadBalancerChoiceModal';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import {
|
|
9
|
+
AzureLoadBalancerActions,
|
|
10
|
+
azureLoadBalancerDetailsSections,
|
|
11
|
+
useAzureLoadBalancerDetails,
|
|
12
|
+
} from './loadBalancer/details/azureLoadBalancerDetails';
|
|
13
|
+
import { AzureLoadBalancerTransformer } from './loadBalancer/loadBalancer.transformer';
|
|
13
14
|
import logo from './logo/logo_azure.png';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
import { registerAzureBakeStage } from './pipeline/stages/bake/azureBakeStage';
|
|
16
|
+
import { registerAzureDestroyAsgStage } from './pipeline/stages/destroyAsg/azureDestroyAsgStage';
|
|
17
|
+
import { registerAzureDisableAsgStage } from './pipeline/stages/disableAsg/azureDisableAsgStage';
|
|
18
|
+
import { registerAzureEnableAsgStage } from './pipeline/stages/enableAsg/azureEnableAsgStage';
|
|
19
|
+
import { AzureSecurityGroupModal } from './securityGroup/configure/AzureSecurityGroupModal';
|
|
20
|
+
import { AzureSecurityGroupDetails } from './securityGroup/details/AzureSecurityGroupDetails';
|
|
21
|
+
import { AzureSecurityGroupReader } from './securityGroup/securityGroup.reader';
|
|
22
|
+
import { AzureSecurityGroupTransformer } from './securityGroup/securityGroup.transformer';
|
|
23
|
+
import { AzureServerGroupCommandBuilder } from './serverGroup/configure/serverGroupCommandBuilder.service';
|
|
24
|
+
import { AzureServerGroupConfigurationService } from './serverGroup/configure/serverGroupConfiguration.service';
|
|
25
|
+
import { AzureCloneServerGroupModal } from './serverGroup/configure/wizard/AzureCloneServerGroupModal';
|
|
26
|
+
import {
|
|
27
|
+
AzureServerGroupActions,
|
|
28
|
+
azureServerGroupDetailsGetter,
|
|
29
|
+
azureServerGroupDetailsSections,
|
|
30
|
+
} from './serverGroup/details/azureServerGroupDetails';
|
|
31
|
+
import { AzureServerGroupTransformer } from './serverGroup/serverGroup.transformer';
|
|
32
|
+
import './validation/applicationName.validator';
|
|
28
33
|
|
|
29
34
|
import './logo/azure.logo.less';
|
|
30
35
|
|
|
31
|
-
export
|
|
32
|
-
module(AZURE_MODULE, [
|
|
33
|
-
AZURE_PIPELINE_STAGES_DESTROYASG_AZUREDESTROYASGSTAGE,
|
|
34
|
-
AZURE_PIPELINE_STAGES_ENABLEASG_AZUREENABLEASGSTAGE,
|
|
35
|
-
AZURE_PIPELINE_STAGES_DISABLEASG_AZUREDISABLEASGSTAGE,
|
|
36
|
-
AZURE_PIPELINE_STAGES_BAKE_AZUREBAKESTAGE,
|
|
37
|
-
AZURE_SERVERGROUP_DETAILS_SERVERGROUP_DETAILS_MODULE,
|
|
38
|
-
AZURE_SERVERGROUP_SERVERGROUP_TRANSFORMER,
|
|
39
|
-
AZURE_SERVERGROUP_CONFIGURE_WIZARD_CLONESERVERGROUP_AZURE_CONTROLLER,
|
|
40
|
-
AZURE_SERVERGROUP_CONFIGURE_SERVERGROUP_CONFIGURE_AZURE_MODULE,
|
|
41
|
-
AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE,
|
|
42
|
-
AZURE_LOADBALANCER_LOADBALANCER_TRANSFORMER,
|
|
43
|
-
AZURE_LOADBALANCER_DETAILS_LOADBALANCERDETAIL_CONTROLLER,
|
|
44
|
-
AZURE_LOADBALANCER_CONFIGURE_CREATELOADBALANCER_CONTROLLER,
|
|
45
|
-
AZURE_INSTANCE_DETAILS_INSTANCE_DETAILS_CONTROLLER,
|
|
46
|
-
AZURE_SECURITYGROUP_DETAILS_SECURITYGROUPDETAIL_CONTROLLER,
|
|
47
|
-
AZURE_SECURITYGROUP_CONFIGURE_CREATESECURITYGROUPCTRL,
|
|
48
|
-
AZURE_SECURITYGROUP_CONFIGURE_EDITSECURITYGROUPCTRL,
|
|
49
|
-
AZURE_SECURITYGROUP_SECURITYGROUP_TRANSFORMER,
|
|
50
|
-
AZURE_SECURITYGROUP_SECURITYGROUP_READER,
|
|
51
|
-
AZURE_IMAGE_IMAGE_READER,
|
|
52
|
-
AZURE_VALIDATION_APPLICATIONNAME_VALIDATOR,
|
|
53
|
-
]).config(function () {
|
|
36
|
+
export function registerAzureProvider(): void {
|
|
54
37
|
CloudProviderRegistry.registerProvider('azure', {
|
|
55
38
|
name: 'Azure',
|
|
56
39
|
logo: {
|
|
57
40
|
path: logo,
|
|
58
41
|
},
|
|
59
42
|
image: {
|
|
60
|
-
reader:
|
|
43
|
+
reader: AzureImageReader,
|
|
61
44
|
},
|
|
62
45
|
serverGroup: {
|
|
63
|
-
transformer:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
46
|
+
transformer: AzureServerGroupTransformer,
|
|
47
|
+
commandBuilder: AzureServerGroupCommandBuilder,
|
|
48
|
+
configurationService: AzureServerGroupConfigurationService,
|
|
49
|
+
CloneServerGroupModal: AzureCloneServerGroupModal,
|
|
50
|
+
detailsGetter: azureServerGroupDetailsGetter,
|
|
51
|
+
detailsActions: AzureServerGroupActions,
|
|
52
|
+
detailsSections: azureServerGroupDetailsSections,
|
|
70
53
|
},
|
|
71
54
|
instance: {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
detailsController: 'azureInstanceDetailsCtrl',
|
|
55
|
+
details: AzureInstanceDetails,
|
|
56
|
+
instanceTypeService: AzureInstanceTypeService,
|
|
75
57
|
},
|
|
76
58
|
loadBalancer: {
|
|
77
|
-
transformer:
|
|
78
|
-
detailsTemplateUrl: require('./loadBalancer/details/loadBalancerDetail.html'),
|
|
79
|
-
detailsController: 'azureLoadBalancerDetailsCtrl',
|
|
80
|
-
createLoadBalancerTemplateUrl: require('./loadBalancer/configure/createLoadBalancer.html'),
|
|
81
|
-
createLoadBalancerController: 'azureCreateLoadBalancerCtrl',
|
|
59
|
+
transformer: AzureLoadBalancerTransformer,
|
|
82
60
|
CreateLoadBalancerModal: AzureLoadBalancerChoiceModal,
|
|
61
|
+
useDetailsHook: useAzureLoadBalancerDetails,
|
|
62
|
+
detailsActions: AzureLoadBalancerActions,
|
|
63
|
+
detailsSections: azureLoadBalancerDetailsSections,
|
|
83
64
|
},
|
|
84
65
|
securityGroup: {
|
|
85
|
-
transformer:
|
|
86
|
-
reader:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
createSecurityGroupTemplateUrl: require('./securityGroup/configure/createSecurityGroup.html'),
|
|
90
|
-
createSecurityGroupController: 'azureCreateSecurityGroupCtrl',
|
|
66
|
+
transformer: AzureSecurityGroupTransformer,
|
|
67
|
+
reader: AzureSecurityGroupReader,
|
|
68
|
+
CreateSecurityGroupModal: AzureSecurityGroupModal,
|
|
69
|
+
details: AzureSecurityGroupDetails,
|
|
91
70
|
},
|
|
92
71
|
});
|
|
93
|
-
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function registerAzurePipelineStages(): void {
|
|
75
|
+
registerAzureDestroyAsgStage();
|
|
76
|
+
registerAzureEnableAsgStage();
|
|
77
|
+
registerAzureDisableAsgStage();
|
|
78
|
+
registerAzureBakeStage();
|
|
79
|
+
}
|
|
94
80
|
|
|
81
|
+
registerAzureProvider();
|
|
82
|
+
registerAzurePipelineStages();
|
|
95
83
|
DeploymentStrategyRegistry.registerProvider('azure', ['redblack']);
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import { module } from 'angular';
|
|
4
|
-
|
|
5
1
|
import { REST } from '@spinnaker/core';
|
|
6
2
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
module(AZURE_IMAGE_IMAGE_READER, []).factory('azureImageReader', function () {
|
|
10
|
-
function findImages(params) {
|
|
3
|
+
export class AzureImageReader {
|
|
4
|
+
findImages(params) {
|
|
11
5
|
return REST('/images/find')
|
|
12
6
|
.query(params)
|
|
13
7
|
.get()
|
|
@@ -21,7 +15,7 @@ module(AZURE_IMAGE_IMAGE_READER, []).factory('azureImageReader', function () {
|
|
|
21
15
|
);
|
|
22
16
|
}
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
getImage(amiName, region, credentials) {
|
|
25
19
|
return REST('/images')
|
|
26
20
|
.path(credentials, region, amiName)
|
|
27
21
|
.query({ provider: 'azure' })
|
|
@@ -35,9 +29,4 @@ module(AZURE_IMAGE_IMAGE_READER, []).factory('azureImageReader', function () {
|
|
|
35
29
|
},
|
|
36
30
|
);
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
findImages: findImages,
|
|
41
|
-
getImage: getImage,
|
|
42
|
-
};
|
|
43
|
-
});
|
|
32
|
+
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { mockHttpClient } from 'core/api/mock/jasmine';
|
|
3
|
+
import { AzureImageReader } from './image.reader';
|
|
3
4
|
|
|
4
5
|
describe('Service: Azure Image Reader', function () {
|
|
5
6
|
var service;
|
|
6
7
|
|
|
7
|
-
beforeEach(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
window.inject(function (azureImageReader) {
|
|
11
|
-
service = azureImageReader;
|
|
12
|
-
}),
|
|
13
|
-
);
|
|
8
|
+
beforeEach(function () {
|
|
9
|
+
service = new AzureImageReader();
|
|
10
|
+
});
|
|
14
11
|
|
|
15
12
|
describe('findImages', function () {
|
|
16
13
|
var query = 'abc',
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import { module } from 'angular';
|
|
4
1
|
import _ from 'lodash';
|
|
5
2
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
module(AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE, []).factory('azureInstanceTypeService', [
|
|
9
|
-
'$q',
|
|
10
|
-
function ($q) {
|
|
3
|
+
export class AzureInstanceTypeService {
|
|
4
|
+
constructor(promiseService) {
|
|
11
5
|
const B = {
|
|
12
6
|
type: 'B-series',
|
|
13
7
|
description:
|
|
@@ -809,7 +803,7 @@ module(AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE, []).factory('azureInstanceTypeS
|
|
|
809
803
|
}
|
|
810
804
|
category.stats = buildStats(category);
|
|
811
805
|
});
|
|
812
|
-
return
|
|
806
|
+
return promiseService.resolve(categories);
|
|
813
807
|
}
|
|
814
808
|
|
|
815
809
|
const getAllTypesByRegion = function getAllTypesByRegion() {
|
|
@@ -822,10 +816,8 @@ module(AZURE_INSTANCE_AZUREINSTANCETYPE_SERVICE, []).factory('azureInstanceTypeS
|
|
|
822
816
|
return locationToInstanceTypesMap[location];
|
|
823
817
|
}
|
|
824
818
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
},
|
|
831
|
-
]);
|
|
819
|
+
this.getCategories = getCategories;
|
|
820
|
+
this.getAvailableTypesForRegions = getAvailableTypesForRegions;
|
|
821
|
+
this.getAllTypesByRegion = getAllTypesByRegion;
|
|
822
|
+
}
|
|
823
|
+
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { nativePromiseService } from '@spinnaker/core';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
beforeEach(function () {
|
|
5
|
-
window.module(require('./azureInstanceType.service').name);
|
|
6
|
-
});
|
|
3
|
+
import { AzureInstanceTypeService } from './azureInstanceType.service';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}),
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
it('should instantiate the controller', function () {
|
|
15
|
-
expect(this.azureInstanceTypeService).toBeDefined();
|
|
5
|
+
describe('Service: InstanceType', function () {
|
|
6
|
+
it('instantiates the service directly', function () {
|
|
7
|
+
expect(new AzureInstanceTypeService(nativePromiseService)).toBeDefined();
|
|
16
8
|
});
|
|
17
9
|
});
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { shallow } from 'enzyme';
|
|
2
|
+
import { UISref } from '@uirouter/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { MenuItem } from 'react-bootstrap';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AccountTag,
|
|
8
|
+
CloudProviderRegistry,
|
|
9
|
+
CollapsibleSection,
|
|
10
|
+
ConfirmationModalService,
|
|
11
|
+
InstanceDetailsHeader,
|
|
12
|
+
InstanceReader,
|
|
13
|
+
InstanceWriter,
|
|
14
|
+
} from '@spinnaker/core';
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
AzureInstanceActionsComponent as AzureInstanceActions,
|
|
18
|
+
AzureInstanceDetails as RoutedAzureInstanceDetails,
|
|
19
|
+
AzureInstanceDetailsComponent as AzureInstanceDetails,
|
|
20
|
+
AzureInstanceInformationSection,
|
|
21
|
+
loadAzureInstanceDetails,
|
|
22
|
+
} from './AzureInstanceDetails';
|
|
23
|
+
import { registerAzureProvider } from '../../azure.module';
|
|
24
|
+
|
|
25
|
+
describe('AzureInstanceDetails', () => {
|
|
26
|
+
const stateService = { go: jasmine.createSpy('go'), includes: jasmine.createSpy('includes').and.returnValue(true) };
|
|
27
|
+
const routerProps = { router: {} as any, stateParams: {}, stateService: stateService as any };
|
|
28
|
+
const instanceParams = {
|
|
29
|
+
account: 'test-account',
|
|
30
|
+
instanceId: 'i-123',
|
|
31
|
+
provider: 'azure',
|
|
32
|
+
region: 'westus',
|
|
33
|
+
} as any;
|
|
34
|
+
|
|
35
|
+
function app(serverGroups: any[] = [], loadBalancers: any[] = []) {
|
|
36
|
+
return {
|
|
37
|
+
isStandalone: false,
|
|
38
|
+
loadBalancers: {
|
|
39
|
+
data: loadBalancers,
|
|
40
|
+
ready: () => Promise.resolve(),
|
|
41
|
+
onRefresh: () => jasmine.createSpy('unsubscribe'),
|
|
42
|
+
},
|
|
43
|
+
serverGroups: {
|
|
44
|
+
data: serverGroups,
|
|
45
|
+
ready: () => Promise.resolve(),
|
|
46
|
+
onRefresh: () => jasmine.createSpy('unsubscribe'),
|
|
47
|
+
},
|
|
48
|
+
} as any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function details(overrides: any = {}) {
|
|
52
|
+
return {
|
|
53
|
+
instanceId: 'i-123',
|
|
54
|
+
instanceType: 'Standard_D2_v2',
|
|
55
|
+
launchTime: 1710000000000,
|
|
56
|
+
privateIpAddress: '10.0.0.4',
|
|
57
|
+
publicDnsName: 'i-123.example.com',
|
|
58
|
+
health: [{ type: 'Discovery', state: 'Up', vipAddress: 'vip-a,vip-b', extra: 'from details' }],
|
|
59
|
+
...overrides,
|
|
60
|
+
} as any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function serverGroup(overrides: any = {}) {
|
|
64
|
+
return {
|
|
65
|
+
account: 'test-account',
|
|
66
|
+
loadBalancers: ['lb-1'],
|
|
67
|
+
name: 'fnord-v001',
|
|
68
|
+
region: 'westus',
|
|
69
|
+
vpcId: 'vnet-1',
|
|
70
|
+
instances: [
|
|
71
|
+
{
|
|
72
|
+
id: 'i-123',
|
|
73
|
+
health: [{ type: 'Discovery', state: 'Down', reason: 'summary reason' }],
|
|
74
|
+
healthState: 'Down',
|
|
75
|
+
instanceType: 'summary-type',
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
...overrides,
|
|
79
|
+
} as any;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function load(appFixture: any, params: any = instanceParams, fetchedDetails: any = details()) {
|
|
83
|
+
spyOn(InstanceReader, 'getInstanceDetails').and.returnValue(Promise.resolve(fetchedDetails));
|
|
84
|
+
return loadAzureInstanceDetails({ app: appFixture, instance: params });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function actionLabels(instance: any): string[] {
|
|
88
|
+
return shallow(<AzureInstanceActions {...routerProps} app={app()} instance={instance} />)
|
|
89
|
+
.find(MenuItem)
|
|
90
|
+
.map((item) => String(item.prop('children')).trim());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
it('loads details for instances found in app.serverGroups.data', async () => {
|
|
94
|
+
const instance = await load(app([serverGroup()]));
|
|
95
|
+
|
|
96
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('test-account', 'westus', 'i-123');
|
|
97
|
+
expect(instance).toEqual(
|
|
98
|
+
jasmine.objectContaining({
|
|
99
|
+
account: 'test-account',
|
|
100
|
+
baseIpAddress: 'i-123.example.com',
|
|
101
|
+
instanceType: 'Standard_D2_v2',
|
|
102
|
+
loadBalancers: ['lb-1'],
|
|
103
|
+
region: 'westus',
|
|
104
|
+
serverGroup: 'fnord-v001',
|
|
105
|
+
vpcId: 'vnet-1',
|
|
106
|
+
vipAddress: ['vip-a', 'vip-b'],
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
expect(instance.healthMetrics[0]).toEqual(
|
|
110
|
+
jasmine.objectContaining({ extra: 'from details', reason: 'summary reason', state: 'Down' }),
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('loads details for instances found directly in app.loadBalancers.data', async () => {
|
|
115
|
+
const loadBalancer = {
|
|
116
|
+
account: 'lb-account',
|
|
117
|
+
instances: [{ id: 'i-123', health: [{ type: 'LoadBalancer', state: 'OutOfService' }] }],
|
|
118
|
+
name: 'lb-1',
|
|
119
|
+
region: 'eastus',
|
|
120
|
+
vpcId: 'lb-vnet',
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const instance = await load(app([], [loadBalancer]));
|
|
124
|
+
|
|
125
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('lb-account', 'eastus', 'i-123');
|
|
126
|
+
expect(instance).toEqual(
|
|
127
|
+
jasmine.objectContaining({ account: 'lb-account', loadBalancers: ['lb-1'], region: 'eastus' }),
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
it('loads details for instances found in app.loadBalancers.data server groups', async () => {
|
|
132
|
+
const loadBalancer = {
|
|
133
|
+
account: 'lb-account',
|
|
134
|
+
instances: [],
|
|
135
|
+
name: 'lb-server-groups',
|
|
136
|
+
region: 'eastus',
|
|
137
|
+
vpcId: 'lb-vnet',
|
|
138
|
+
serverGroups: [serverGroup({ account: 'other-account', isDisabled: false, region: 'centralus' })],
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const instance = await load(app([], [loadBalancer]));
|
|
142
|
+
|
|
143
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('lb-account', 'eastus', 'i-123');
|
|
144
|
+
expect(instance).toEqual(
|
|
145
|
+
jasmine.objectContaining({ account: 'lb-account', loadBalancers: ['lb-server-groups'], region: 'eastus' }),
|
|
146
|
+
);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('loads details for instances in disabled server groups through load balancers', async () => {
|
|
150
|
+
const disabledServerGroup = serverGroup({ account: 'disabled-account', isDisabled: true, region: 'centralus' });
|
|
151
|
+
const loadBalancer = {
|
|
152
|
+
account: 'lb-account',
|
|
153
|
+
instances: [],
|
|
154
|
+
name: 'lb-disabled',
|
|
155
|
+
region: 'eastus',
|
|
156
|
+
vpcId: 'lb-vnet',
|
|
157
|
+
serverGroups: [disabledServerGroup],
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const instance = await load(app([], [loadBalancer]));
|
|
161
|
+
|
|
162
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('lb-account', 'eastus', 'i-123');
|
|
163
|
+
expect(instance).toEqual(
|
|
164
|
+
jasmine.objectContaining({ account: 'lb-account', loadBalancers: ['lb-disabled'], region: 'eastus' }),
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
it('loads standalone instance params without an app serverGroups data source', async () => {
|
|
169
|
+
const standaloneApp = { isStandalone: true } as any;
|
|
170
|
+
const instance = await load(
|
|
171
|
+
standaloneApp,
|
|
172
|
+
instanceParams,
|
|
173
|
+
details({ health: [{ type: 'LoadBalancer', state: 'Up' }] }),
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('test-account', 'westus', 'i-123');
|
|
177
|
+
expect(instance).toEqual(jasmine.objectContaining({ account: 'test-account', region: 'westus' }));
|
|
178
|
+
expect(instance.healthMetrics).toEqual([jasmine.objectContaining({ type: 'LoadBalancer', state: 'Up' })] as any);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('returns not-found state when no summary exists', async () => {
|
|
182
|
+
spyOn(InstanceReader, 'getInstanceDetails');
|
|
183
|
+
|
|
184
|
+
const instance = await loadAzureInstanceDetails({ app: app(), instance: instanceParams });
|
|
185
|
+
|
|
186
|
+
expect(instance).toEqual({ instanceIdNotFound: 'i-123' } as any);
|
|
187
|
+
expect(InstanceReader.getInstanceDetails).not.toHaveBeenCalled();
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('renders legacy basic details and not-found content', () => {
|
|
191
|
+
const wrapper = shallow(
|
|
192
|
+
<AzureInstanceInformationSection
|
|
193
|
+
instance={
|
|
194
|
+
{
|
|
195
|
+
account: 'test-account',
|
|
196
|
+
instanceType: 'Standard_D2_v2',
|
|
197
|
+
launchTime: 1710000000000,
|
|
198
|
+
provider: 'azure',
|
|
199
|
+
region: 'westus',
|
|
200
|
+
serverGroup: 'fnord-v001',
|
|
201
|
+
} as any
|
|
202
|
+
}
|
|
203
|
+
/>,
|
|
204
|
+
);
|
|
205
|
+
const content = shallow(<div>{wrapper.find(CollapsibleSection).prop('children')}</div>);
|
|
206
|
+
const text = content.text();
|
|
207
|
+
|
|
208
|
+
expect(text).toContain('Launched');
|
|
209
|
+
expect(content.find(AccountTag).prop('account')).toBe('test-account');
|
|
210
|
+
expect(text).toContain('westus');
|
|
211
|
+
expect(text).toContain('Standard_D2_v2');
|
|
212
|
+
expect(content.find(UISref).prop('to')).toBe('^.serverGroup');
|
|
213
|
+
expect(content.find(UISref).prop('params')).toEqual({
|
|
214
|
+
accountId: 'test-account',
|
|
215
|
+
provider: 'azure',
|
|
216
|
+
region: 'westus',
|
|
217
|
+
serverGroup: 'fnord-v001',
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
it('renders the instance header and not-found state', () => {
|
|
222
|
+
const loaded = shallow(
|
|
223
|
+
<AzureInstanceDetails {...routerProps} app={app()} instance={instanceParams} initialInstance={details()} />,
|
|
224
|
+
);
|
|
225
|
+
const notFound = shallow(
|
|
226
|
+
<AzureInstanceDetails
|
|
227
|
+
{...routerProps}
|
|
228
|
+
app={app()}
|
|
229
|
+
instance={instanceParams}
|
|
230
|
+
initialInstance={{ instanceIdNotFound: 'i-missing' } as any}
|
|
231
|
+
/>,
|
|
232
|
+
);
|
|
233
|
+
|
|
234
|
+
expect(loaded.find(InstanceDetailsHeader).prop('instanceId')).toBe('i-123');
|
|
235
|
+
expect(loaded.find(AzureInstanceInformationSection).exists()).toBe(true);
|
|
236
|
+
expect(notFound.text()).toContain('Instance not found.');
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
it('loads the new instance and clears stale details when the mounted instance route changes', async () => {
|
|
240
|
+
const application = app([
|
|
241
|
+
serverGroup({
|
|
242
|
+
instances: [
|
|
243
|
+
{ id: 'i-123', health: [], instanceType: 'old-summary-type' },
|
|
244
|
+
{ id: 'i-456', health: [], instanceType: 'new-summary-type' },
|
|
245
|
+
],
|
|
246
|
+
}),
|
|
247
|
+
]);
|
|
248
|
+
spyOn(InstanceReader, 'getInstanceDetails').and.callFake((_account: string, _region: string, instanceId: string) =>
|
|
249
|
+
Promise.resolve(details({ instanceId, instanceType: instanceId === 'i-456' ? 'new-type' : 'old-type' })),
|
|
250
|
+
);
|
|
251
|
+
const wrapper = shallow(
|
|
252
|
+
<AzureInstanceDetails
|
|
253
|
+
{...routerProps}
|
|
254
|
+
app={application}
|
|
255
|
+
instance={instanceParams}
|
|
256
|
+
initialInstance={details({ instanceId: 'i-123', instanceType: 'old-type' })}
|
|
257
|
+
/>,
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
wrapper.setProps({ instance: { ...instanceParams, instanceId: 'i-456' } });
|
|
261
|
+
|
|
262
|
+
expect(InstanceReader.getInstanceDetails).toHaveBeenCalledWith('test-account', 'westus', 'i-456');
|
|
263
|
+
expect(wrapper.find(InstanceDetailsHeader).prop('instanceId')).toBe('i-456');
|
|
264
|
+
expect(wrapper.find(AzureInstanceInformationSection).exists()).toBe(false);
|
|
265
|
+
|
|
266
|
+
await Promise.resolve();
|
|
267
|
+
await Promise.resolve();
|
|
268
|
+
wrapper.update();
|
|
269
|
+
|
|
270
|
+
expect(wrapper.find(AzureInstanceInformationSection).prop('instance').instanceType).toBe('new-type');
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
it('preserves supported instance actions', () => {
|
|
274
|
+
spyOn(ConfirmationModalService, 'confirm');
|
|
275
|
+
spyOn(InstanceWriter, 'terminateInstance').and.returnValue(Promise.resolve({} as any));
|
|
276
|
+
spyOn(InstanceWriter, 'terminateInstanceAndShrinkServerGroup').and.returnValue(Promise.resolve({} as any));
|
|
277
|
+
spyOn(InstanceWriter, 'rebootInstance').and.returnValue(Promise.resolve({} as any));
|
|
278
|
+
spyOn(InstanceWriter, 'registerInstanceWithLoadBalancer').and.returnValue(Promise.resolve({} as any));
|
|
279
|
+
spyOn(InstanceWriter, 'deregisterInstanceFromLoadBalancer').and.returnValue(Promise.resolve({} as any));
|
|
280
|
+
spyOn(InstanceWriter, 'enableInstanceInDiscovery').and.returnValue(Promise.resolve({} as any));
|
|
281
|
+
spyOn(InstanceWriter, 'disableInstanceInDiscovery').and.returnValue(Promise.resolve({} as any));
|
|
282
|
+
const application = app();
|
|
283
|
+
const instance = {
|
|
284
|
+
account: 'test-account',
|
|
285
|
+
health: [
|
|
286
|
+
{ type: 'LoadBalancer', state: 'OutOfService' },
|
|
287
|
+
{ type: 'Discovery', state: 'OutOfService' },
|
|
288
|
+
],
|
|
289
|
+
instanceId: 'i-123',
|
|
290
|
+
loadBalancers: ['lb-1'],
|
|
291
|
+
serverGroup: 'fnord-v001',
|
|
292
|
+
} as any;
|
|
293
|
+
const wrapper = shallow(<AzureInstanceActions {...routerProps} app={application} instance={instance} />);
|
|
294
|
+
|
|
295
|
+
wrapper.find(MenuItem).forEach((item) => item.prop('onClick')({} as any));
|
|
296
|
+
|
|
297
|
+
expect(ConfirmationModalService.confirm).toHaveBeenCalledTimes(7);
|
|
298
|
+
(ConfirmationModalService.confirm as jasmine.Spy).calls.all().forEach((call) => call.args[0].submitMethod());
|
|
299
|
+
expect(InstanceWriter.terminateInstance).toHaveBeenCalledWith(instance, application);
|
|
300
|
+
expect(InstanceWriter.terminateInstanceAndShrinkServerGroup).toHaveBeenCalledWith(instance, application);
|
|
301
|
+
expect(InstanceWriter.rebootInstance).toHaveBeenCalledWith(instance, application);
|
|
302
|
+
expect(InstanceWriter.registerInstanceWithLoadBalancer).toHaveBeenCalledWith(instance, application);
|
|
303
|
+
expect(InstanceWriter.deregisterInstanceFromLoadBalancer).toHaveBeenCalledWith(instance, application);
|
|
304
|
+
expect(InstanceWriter.enableInstanceInDiscovery).toHaveBeenCalledWith(instance, application);
|
|
305
|
+
expect(InstanceWriter.disableInstanceInDiscovery).toHaveBeenCalledWith(instance, application);
|
|
306
|
+
(ConfirmationModalService.confirm as jasmine.Spy).calls.first().args[0].taskMonitorConfig.onTaskComplete();
|
|
307
|
+
expect(stateService.includes).toHaveBeenCalledWith('**.instanceDetails', { instanceId: 'i-123' });
|
|
308
|
+
expect(stateService.go).toHaveBeenCalledWith('^');
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
it('renders load balancer actions based on load balancer health', () => {
|
|
312
|
+
expect(
|
|
313
|
+
actionLabels({
|
|
314
|
+
health: [{ type: 'LoadBalancer', state: 'OutOfService' }],
|
|
315
|
+
instanceId: 'i-123',
|
|
316
|
+
loadBalancers: ['lb-1'],
|
|
317
|
+
} as any),
|
|
318
|
+
).toEqual(['Terminate', 'Reboot', 'Register with Load Balancer', 'Deregister from Load Balancer']);
|
|
319
|
+
|
|
320
|
+
expect(
|
|
321
|
+
actionLabels({
|
|
322
|
+
health: [{ type: 'LoadBalancer', state: 'InService' }],
|
|
323
|
+
instanceId: 'i-123',
|
|
324
|
+
loadBalancers: ['lb-1'],
|
|
325
|
+
} as any),
|
|
326
|
+
).toEqual(['Terminate', 'Reboot', 'Deregister from Load Balancer']);
|
|
327
|
+
|
|
328
|
+
expect(
|
|
329
|
+
actionLabels({
|
|
330
|
+
health: [],
|
|
331
|
+
instanceId: 'i-123',
|
|
332
|
+
loadBalancers: ['lb-1'],
|
|
333
|
+
} as any),
|
|
334
|
+
).toEqual(['Terminate', 'Reboot', 'Register with Load Balancer']);
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
it('renders discovery actions based on discovery health', () => {
|
|
338
|
+
expect(
|
|
339
|
+
actionLabels({
|
|
340
|
+
health: [{ type: 'Discovery', state: 'OutOfService' }],
|
|
341
|
+
instanceId: 'i-123',
|
|
342
|
+
} as any),
|
|
343
|
+
).toEqual(['Terminate', 'Reboot', 'Enable in Discovery', 'Disable in Discovery']);
|
|
344
|
+
|
|
345
|
+
expect(
|
|
346
|
+
actionLabels({
|
|
347
|
+
health: [{ type: 'Discovery', state: 'Up' }],
|
|
348
|
+
instanceId: 'i-123',
|
|
349
|
+
} as any),
|
|
350
|
+
).toEqual(['Terminate', 'Reboot', 'Disable in Discovery']);
|
|
351
|
+
|
|
352
|
+
expect(actionLabels({ health: [], instanceId: 'i-123' } as any)).toEqual(['Terminate', 'Reboot']);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it('registers Azure React instance details with the provider registry', () => {
|
|
356
|
+
registerAzureProvider();
|
|
357
|
+
|
|
358
|
+
expect(CloudProviderRegistry.getValue('azure', 'instance.details').render).toBe(
|
|
359
|
+
(RoutedAzureInstanceDetails as any).render,
|
|
360
|
+
);
|
|
361
|
+
expect(CloudProviderRegistry.getValue('azure', 'instance.detailsController')).toBeNull();
|
|
362
|
+
expect(CloudProviderRegistry.getValue('azure', 'instance.detailsTemplateUrl')).toBeNull();
|
|
363
|
+
});
|
|
364
|
+
});
|