@spinnaker/amazon 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/aws.module.d.ts +2 -1
- package/dist/aws.services.d.ts +8 -0
- package/dist/certificates/AmazonCertificateReader.d.ts +1 -1
- package/dist/domain/IAmazonServerGroup.d.ts +10 -0
- package/dist/function/CreateLambdaFunction.d.ts +10 -5
- package/dist/function/configure/Network.d.ts +3 -0
- package/dist/function/details/FunctionActions.d.ts +3 -0
- package/dist/function/function.transformer.d.ts +1 -0
- package/dist/image/image.reader.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/instance/amazon.instance.write.service.d.ts +5 -5
- package/dist/instance/awsInstanceType.service.d.ts +13 -2
- package/dist/instance/details/AmazonInstanceDetails.d.ts +67 -0
- package/dist/instance/index.d.ts +1 -0
- package/dist/keyPairs/KeyPairsReader.d.ts +1 -1
- package/dist/loadBalancer/AmazonLoadBalancersTag.d.ts +7 -4
- package/dist/loadBalancer/OidcConfigReader.d.ts +1 -1
- package/dist/loadBalancer/TargetGroupDetails.d.ts +37 -3
- package/dist/loadBalancer/amazonLoadBalancerDataUtils.d.ts +1 -1
- package/dist/loadBalancer/configure/AmazonLoadBalancerChoiceModal.d.ts +6 -2
- package/dist/loadBalancer/configure/LoadBalancerTypes.d.ts +4 -4
- package/dist/loadBalancer/configure/application/CreateApplicationLoadBalancer.d.ts +10 -5
- package/dist/loadBalancer/configure/classic/CreateClassicLoadBalancer.d.ts +12 -7
- package/dist/loadBalancer/configure/common/SecurityGroups.d.ts +4 -0
- package/dist/loadBalancer/configure/network/CreateNetworkLoadBalancer.d.ts +10 -5
- package/dist/loadBalancer/details/LoadBalancerActions.d.ts +9 -2
- package/dist/loadBalancer/details/amazonLoadBalancerDetails.d.ts +22 -0
- package/dist/loadBalancer/index.d.ts +1 -0
- package/dist/loadBalancer/loadBalancer.transformer.d.ts +1 -1
- package/dist/pipeline/stages/AmazonStageConfig.d.ts +11 -0
- package/dist/pipeline/stages/bake/AwsBakeStageConfig.d.ts +66 -0
- package/dist/pipeline/stages/cloneServerGroup/AwsCloneServerGroupStageConfig.d.ts +20 -0
- package/dist/pipeline/stages/deleteLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.d.ts +5 -4
- package/dist/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.d.ts +1 -1
- package/dist/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.d.ts +1 -3
- package/dist/pipeline/stages/deployLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/destroyAsg/awsDestroyAsgStage.d.ts +26 -2
- package/dist/pipeline/stages/disableAsg/AwsDisableAsgStageConfig.d.ts +27 -0
- package/dist/pipeline/stages/disableCluster/AwsDisableClusterStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/enableAsg/AwsEnableAsgStageConfig.d.ts +20 -0
- package/dist/pipeline/stages/findAmi/awsFindAmiStage.d.ts +17 -2
- package/dist/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/findImageFromTags/awsFindImageFromTagsStage.d.ts +12 -2
- package/dist/pipeline/stages/invokeLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/modifyScalingProcess/ModifyScalingProcessStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.d.ts +20 -2
- package/dist/pipeline/stages/modifyWarmPool/ModifyWarmPoolStageConfig.d.ts +3 -0
- package/dist/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.d.ts +20 -0
- package/dist/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.d.ts +17 -0
- package/dist/pipeline/stages/resizeAsg/awsResizeAsgStage.d.ts +40 -2
- package/dist/pipeline/stages/rollbackCluster/AwsRollbackClusterStageConfig.d.ts +19 -0
- package/dist/pipeline/stages/routeLambda/index.d.ts +1 -1
- package/dist/pipeline/stages/scaleDownCluster/AwsScaleDownClusterStageConfig.d.ts +22 -0
- package/dist/pipeline/stages/shrinkCluster/AwsShrinkClusterStageConfig.d.ts +21 -0
- package/dist/pipeline/stages/tagImage/awsTagImageStage.d.ts +5 -2
- package/dist/pipeline/stages/updateCodeLambda/index.d.ts +1 -1
- package/dist/search/searchResultFormatter.d.ts +4 -2
- package/dist/securityGroup/configure/AmazonSecurityGroupModal.d.ts +43 -0
- package/dist/securityGroup/details/AmazonSecurityGroupDetails.d.ts +62 -0
- package/dist/securityGroup/details/index.d.ts +1 -0
- package/dist/securityGroup/index.d.ts +1 -0
- package/dist/securityGroup/securityGroup.reader.d.ts +0 -1
- package/dist/securityGroup/securityGroup.transformer.d.ts +11 -2
- package/dist/serverGroup/configure/serverGroupCommandBuilder.service.d.ts +23 -7
- package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +17 -13
- package/dist/serverGroup/configure/wizard/AmazonCloneServerGroupModal.d.ts +16 -6
- package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +6 -3
- package/dist/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.d.ts +3 -0
- package/dist/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.d.ts +4 -0
- package/dist/serverGroup/details/AmazonServerGroupActions.d.ts +10 -2
- package/dist/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.d.ts +17 -0
- package/dist/serverGroup/details/advancedSettings/index.d.ts +1 -0
- package/dist/serverGroup/details/resize/AmazonResizeServerGroupModal.d.ts +5 -3
- package/dist/serverGroup/details/rollback/AmazonRollbackServerGroupModal.d.ts +67 -0
- package/dist/serverGroup/details/rollback/index.d.ts +2 -0
- package/dist/serverGroup/details/rollback/rollbackServerGroupSelection.d.ts +9 -0
- package/dist/serverGroup/details/scalingPolicy/ScalingPolicyWriter.d.ts +2 -2
- package/dist/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.d.ts +0 -1
- package/dist/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.d.ts +24 -0
- package/dist/serverGroup/details/scalingProcesses/index.d.ts +2 -0
- package/dist/serverGroup/details/scheduledActions/EditScheduledActionsModal.d.ts +31 -0
- package/dist/serverGroup/details/scheduledActions/index.d.ts +1 -0
- package/dist/serverGroup/details/sections/AdvancedSettingsDetailsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/AmazonCapacityDetailsSection.d.ts +3 -0
- package/dist/serverGroup/details/sections/ScalingProcessesDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/ScheduledActionsDetailsSection.d.ts +1 -1
- package/dist/serverGroup/details/sections/SecurityGroupsDetailsSection.d.ts +4 -1
- package/dist/serverGroup/details/sections/WarmPoolDetailsSection.d.ts +6 -0
- package/dist/serverGroup/details/sections/index.d.ts +1 -0
- package/dist/serverGroup/details/securityGroups/EditSecurityGroupsModal.d.ts +32 -0
- package/dist/serverGroup/details/securityGroups/index.d.ts +1 -0
- package/dist/serverGroup/details/warmPool/ModifyWarmPoolModal.d.ts +26 -0
- package/dist/serverGroup/details/warmPool/WarmPoolService.d.ts +6 -0
- package/dist/serverGroup/details/warmPool/index.d.ts +2 -0
- package/dist/serverGroup/serverGroup.transformer.d.ts +1 -2
- package/dist/vpc/VpcReader.d.ts +2 -2
- package/dist/vpc/index.d.ts +1 -0
- package/package.json +3 -12
- package/src/aws.module.spec.ts +296 -0
- package/src/aws.module.ts +107 -112
- package/src/aws.services.ts +21 -0
- package/src/certificates/AmazonCertificateReader.ts +1 -1
- package/src/domain/IAmazonServerGroup.ts +9 -0
- package/src/function/CreateLambdaFunction.tsx +29 -16
- package/src/function/configure/Network.tsx +8 -4
- package/src/function/details/AmazonFunctionDetails.tsx +4 -5
- package/src/function/details/FunctionActions.tsx +5 -1
- package/src/function/function.transformer.ts +4 -0
- package/src/image/image.reader.ts +3 -5
- package/src/index.ts +2 -2
- package/src/instance/amazon.instance.write.service.ts +15 -4
- package/src/instance/awsInstanceType.service.spec.js +172 -136
- package/src/instance/awsInstanceType.service.ts +142 -154
- package/src/instance/details/AmazonInstanceDetails.spec.tsx +79 -0
- package/src/instance/details/AmazonInstanceDetails.tsx +644 -0
- package/src/instance/details/InstanceInformation.tsx +11 -14
- package/src/instance/details/InstanceSecurityGroups.tsx +20 -23
- package/src/instance/details/InstanceTags.tsx +5 -3
- package/src/instance/index.ts +1 -0
- package/src/keyPairs/KeyPairsReader.ts +1 -1
- package/src/loadBalancer/AmazonLoadBalancersTag.spec.tsx +39 -0
- package/src/loadBalancer/AmazonLoadBalancersTag.tsx +21 -14
- package/src/loadBalancer/OidcConfigReader.ts +1 -1
- package/src/loadBalancer/TargetGroupDetails.spec.tsx +113 -0
- package/src/loadBalancer/TargetGroupDetails.tsx +287 -7
- package/src/loadBalancer/amazonLoadBalancerDataUtils.ts +21 -21
- package/src/loadBalancer/configure/AmazonLoadBalancerChoiceModal.tsx +17 -4
- package/src/loadBalancer/configure/LoadBalancerTypes.ts +7 -4
- package/src/loadBalancer/configure/application/ALBListeners.tsx +1 -2
- package/src/loadBalancer/configure/application/CreateApplicationLoadBalancer.tsx +28 -18
- package/src/loadBalancer/configure/classic/CreateClassicLoadBalancer.tsx +29 -19
- package/src/loadBalancer/configure/common/LoadBalancerLocation.tsx +1 -1
- package/src/loadBalancer/configure/common/SecurityGroups.spec.tsx +27 -0
- package/src/loadBalancer/configure/common/SecurityGroups.tsx +11 -5
- package/src/loadBalancer/configure/network/CreateNetworkLoadBalancer.tsx +28 -18
- package/src/loadBalancer/details/LoadBalancerActions.tsx +19 -5
- package/src/loadBalancer/details/amazonLoadBalancerDetails.spec.tsx +141 -0
- package/src/loadBalancer/details/amazonLoadBalancerDetails.tsx +599 -0
- package/src/loadBalancer/index.ts +1 -0
- package/src/loadBalancer/loadBalancer.transformer.ts +3 -4
- package/src/pipeline/stages/AmazonStageConfig.spec.tsx +103 -0
- package/src/pipeline/stages/AmazonStageConfig.tsx +259 -0
- package/src/pipeline/stages/bake/AwsBakeStageConfig.tsx +708 -0
- package/src/pipeline/stages/cloneServerGroup/AwsCloneServerGroupStageConfig.tsx +275 -0
- package/src/pipeline/stages/deleteLambda/index.ts +2 -6
- package/src/pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo.tsx +14 -33
- package/src/pipeline/stages/deployCloudFormation/DeployCloudFormationStackStageConfig.tsx +264 -0
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.spec.tsx +403 -0
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackStage.ts +21 -29
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service.ts +1 -11
- package/src/pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecutionApproval.tsx +4 -3
- package/src/pipeline/stages/deployLambda/components/NetworkForm.tsx +3 -6
- package/src/pipeline/stages/deployLambda/index.ts +2 -6
- package/src/pipeline/stages/destroyAsg/awsDestroyAsgStage.js +28 -65
- package/src/pipeline/stages/disableAsg/AwsDisableAsgStageConfig.tsx +103 -0
- package/src/pipeline/stages/disableCluster/AwsDisableClusterStageConfig.tsx +119 -0
- package/src/pipeline/stages/enableAsg/AwsEnableAsgStageConfig.tsx +98 -0
- package/src/pipeline/stages/findAmi/awsFindAmiStage.js +22 -79
- package/src/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.spec.tsx +122 -0
- package/src/pipeline/stages/findImageFromTags/AwsFindImageFromTagsStageConfig.tsx +71 -0
- package/src/pipeline/stages/findImageFromTags/awsFindImageFromTagsStage.js +17 -32
- package/src/pipeline/stages/invokeLambda/index.ts +2 -6
- package/src/pipeline/stages/modifyScalingProcess/ModifyScalingProcessStageConfig.tsx +146 -0
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.js +27 -98
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.spec.tsx +167 -0
- package/src/pipeline/stages/modifyWarmPool/ModifyWarmPoolStageConfig.tsx +157 -0
- package/src/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.js +26 -0
- package/src/pipeline/stages/modifyWarmPool/modifyWarmPoolStage.spec.tsx +89 -0
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.spec.tsx +617 -0
- package/src/pipeline/stages/resizeAsg/AwsResizeAsgStageConfig.tsx +340 -0
- package/src/pipeline/stages/resizeAsg/awsResizeAsgStage.js +34 -125
- package/src/pipeline/stages/rollbackCluster/AwsRollbackClusterStageConfig.tsx +129 -0
- package/src/pipeline/stages/routeLambda/index.ts +2 -6
- package/src/pipeline/stages/scaleDownCluster/AwsScaleDownClusterStageConfig.tsx +121 -0
- package/src/pipeline/stages/shrinkCluster/AwsShrinkClusterStageConfig.tsx +136 -0
- package/src/pipeline/stages/tagImage/awsTagImageStage.spec.tsx +167 -0
- package/src/pipeline/stages/tagImage/awsTagImageStage.tsx +94 -0
- package/src/pipeline/stages/updateCodeLambda/index.ts +2 -6
- package/src/routerConsumers.spec.tsx +207 -0
- package/src/search/searchResultFormatter.ts +9 -16
- package/src/securityGroup/configure/AmazonSecurityGroupModal.spec.tsx +170 -0
- package/src/securityGroup/configure/AmazonSecurityGroupModal.tsx +440 -0
- package/src/securityGroup/details/AmazonSecurityGroupDetails.spec.tsx +62 -0
- package/src/securityGroup/details/AmazonSecurityGroupDetails.tsx +444 -0
- package/src/securityGroup/details/IPRangeRules.tsx +1 -1
- package/src/securityGroup/details/index.ts +1 -0
- package/src/securityGroup/index.ts +1 -0
- package/src/securityGroup/securityGroup.reader.ts +0 -5
- package/src/securityGroup/securityGroup.transformer.ts +35 -0
- package/src/serverGroup/configure/AmazonImageSelectInput.spec.tsx +104 -80
- package/src/serverGroup/configure/AmazonImageSelectInput.tsx +37 -18
- package/src/serverGroup/configure/serverGroupCommandBuilder.aws.service.spec.js +28 -66
- package/src/serverGroup/configure/serverGroupCommandBuilder.service.ts +476 -465
- package/src/serverGroup/configure/serverGroupCommandBuilder.spec.js +76 -124
- package/src/serverGroup/configure/serverGroupConfiguration.service.ts +106 -103
- package/src/serverGroup/configure/wizard/AmazonCloneServerGroupModal.tsx +65 -25
- package/src/serverGroup/configure/wizard/instanceType/CpuCreditsToggle.tsx +3 -3
- package/src/serverGroup/configure/wizard/instanceType/advancedMode/AdvancedModeSelector.tsx +2 -2
- package/src/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.spec.tsx +105 -0
- package/src/serverGroup/configure/wizard/instanceType/simpleMode/SimpleModeSelector.tsx +20 -6
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.spec.tsx +39 -0
- package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.tsx +10 -9
- package/src/serverGroup/configure/wizard/pages/ServerGroupInstanceType.tsx +2 -2
- package/src/serverGroup/configure/wizard/pages/ServerGroupLoadBalancers.tsx +5 -2
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.spec.tsx +53 -0
- package/src/serverGroup/configure/wizard/pages/advancedSettings/ServerGroupAdvancedSettingsCommon.tsx +35 -33
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.spec.tsx +20 -0
- package/src/serverGroup/configure/wizard/securityGroups/SecurityGroupSelector.tsx +9 -4
- package/src/serverGroup/details/AmazonServerGroupActions.spec.tsx +186 -0
- package/src/serverGroup/details/AmazonServerGroupActions.tsx +37 -87
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.spec.tsx +110 -0
- package/src/serverGroup/details/advancedSettings/EditAsgAdvancedSettingsModal.tsx +117 -0
- package/src/serverGroup/details/advancedSettings/index.ts +1 -0
- package/src/serverGroup/details/amazonServerGroupDetailsGetter.ts +4 -4
- package/src/serverGroup/details/resize/AmazonResizeServerGroupModal.tsx +16 -6
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.spec.tsx +285 -0
- package/src/serverGroup/details/rollback/AmazonRollbackServerGroupModal.tsx +449 -0
- package/src/serverGroup/details/rollback/index.ts +2 -0
- package/src/serverGroup/details/rollback/rollbackServerGroupSelection.spec.ts +101 -0
- package/src/serverGroup/details/rollback/rollbackServerGroupSelection.ts +81 -0
- package/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx +4 -4
- package/src/serverGroup/details/scalingPolicy/ScalingPolicyWriter.ts +2 -5
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/DimensionsEditor.tsx +0 -2
- package/src/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.spec.tsx +74 -0
- package/src/serverGroup/details/scalingProcesses/ModifyScalingProcessesModal.tsx +140 -0
- package/src/serverGroup/details/scalingProcesses/index.ts +2 -0
- package/src/serverGroup/details/scheduledActions/EditScheduledActionsModal.spec.tsx +115 -0
- package/src/serverGroup/details/scheduledActions/EditScheduledActionsModal.tsx +205 -0
- package/src/serverGroup/details/scheduledActions/index.ts +1 -0
- package/src/serverGroup/details/sections/AdvancedSettingsDetailsSection.tsx +7 -14
- package/src/serverGroup/details/sections/AmazonCapacityDetailsSection.tsx +14 -2
- package/src/serverGroup/details/sections/AmazonServerGroupMaintenanceActions.spec.tsx +148 -0
- package/src/serverGroup/details/sections/InstancesDistributionDetailsSection.spec.tsx +1 -5
- package/src/serverGroup/details/sections/LaunchTemplateDetailsSection.spec.tsx +1 -5
- package/src/serverGroup/details/sections/ScalingProcessesDetailsSection.tsx +8 -20
- package/src/serverGroup/details/sections/ScheduledActionsDetailsSection.tsx +7 -12
- package/src/serverGroup/details/sections/SecurityGroupsDetailsSection.tsx +14 -19
- package/src/serverGroup/details/sections/WarmPoolDetailsSection.tsx +44 -0
- package/src/serverGroup/details/sections/index.ts +1 -0
- package/src/serverGroup/details/securityGroups/EditSecurityGroupsModal.spec.tsx +161 -0
- package/src/serverGroup/details/securityGroups/EditSecurityGroupsModal.tsx +177 -0
- package/src/serverGroup/details/securityGroups/index.ts +1 -0
- package/src/serverGroup/details/warmPool/ModifyWarmPoolModal.spec.tsx +69 -0
- package/src/serverGroup/details/warmPool/ModifyWarmPoolModal.tsx +191 -0
- package/src/serverGroup/details/warmPool/WarmPoolService.spec.ts +30 -0
- package/src/serverGroup/details/warmPool/WarmPoolService.ts +15 -0
- package/src/serverGroup/details/warmPool/index.ts +2 -0
- package/src/serverGroup/serverGroup.transformer.ts +1 -6
- package/src/vpc/VpcReader.ts +2 -2
- package/src/vpc/index.ts +1 -0
- package/dist/common/common.module.d.ts +0 -1
- package/dist/common/footer.component.d.ts +0 -1
- package/dist/function/function.module.d.ts +0 -1
- package/dist/instance/details/amazonInstanceInformation.component.d.ts +0 -1
- package/dist/instance/details/instance.details.controller.d.ts +0 -2
- package/dist/instance/details/instanceDns.component.d.ts +0 -1
- package/dist/instance/details/instanceSecurityGroups.component.d.ts +0 -1
- package/dist/instance/details/instanceStatus.component.d.ts +0 -1
- package/dist/instance/details/instanceTags.component.d.ts +0 -1
- package/dist/loadBalancer/details/loadBalancerActions.component.d.ts +0 -1
- package/dist/loadBalancer/details/loadBalancerDetails.controller.d.ts +0 -41
- package/dist/loadBalancer/details/targetGroupDetails.controller.d.ts +0 -30
- package/dist/loadBalancer/loadBalancer.module.d.ts +0 -1
- package/dist/loadBalancer/targetGroup.states.d.ts +0 -1
- package/dist/pipeline/stages/bake/awsBakeStage.d.ts +0 -2
- package/dist/pipeline/stages/bake/bakeExecutionDetails.controller.d.ts +0 -2
- package/dist/pipeline/stages/cloneServerGroup/awsCloneServerGroupStage.d.ts +0 -2
- package/dist/pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component.d.ts +0 -1
- package/dist/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.d.ts +0 -25
- package/dist/pipeline/stages/disableAsg/awsDisableAsgStage.d.ts +0 -2
- package/dist/pipeline/stages/disableCluster/awsDisableClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/enableAsg/awsEnableAsgStage.d.ts +0 -2
- package/dist/pipeline/stages/rollbackCluster/awsRollbackClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/scaleDownCluster/awsScaleDownClusterStage.d.ts +0 -2
- package/dist/pipeline/stages/shrinkCluster/awsShrinkClusterStage.d.ts +0 -2
- package/dist/reactShims/aws.react.injector.d.ts +0 -18
- package/dist/reactShims/aws.react.module.d.ts +0 -1
- package/dist/reactShims/index.d.ts +0 -1
- 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/configure/configSecurityGroup.mixin.controller.d.ts +0 -2
- package/dist/securityGroup/configure/ingressRuleGroupSelector.component.d.ts +0 -1
- package/dist/securityGroup/configure/securityGroupDetailsCustom.component.d.ts +0 -1
- package/dist/securityGroup/configure/securityGroupDetailsCustom.d.ts +0 -10
- package/dist/securityGroup/details/securityGroupDetail.controller.d.ts +0 -2
- package/dist/securityGroup/details/securityGroupIpRangeRules.component.d.ts +0 -1
- package/dist/securityGroup/securityGroup.module.d.ts +0 -1
- package/dist/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/rollback/rollbackServerGroup.controller.d.ts +0 -2
- package/dist/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.d.ts +0 -1
- package/dist/serverGroup/details/scalingPolicy/scalingPolicy.module.d.ts +0 -1
- package/dist/serverGroup/details/scalingPolicy/scalingPolicySummary.component.d.ts +0 -1
- package/dist/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.d.ts +0 -2
- package/dist/serverGroup/details/scheduledAction/editScheduledActions.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/securityGroup/editSecurityGroups.modal.controller.d.ts +0 -2
- package/dist/serverGroup/details/serverGroupDetails.module.d.ts +0 -1
- package/dist/subnet/subnet.renderer.d.ts +0 -5
- package/dist/vpc/vpc.module.d.ts +0 -1
- package/src/applicationProviderFields/awsFields.html +0 -13
- package/src/common/common.module.ts +0 -6
- package/src/common/footer.component.ts +0 -29
- package/src/function/function.module.ts +0 -5
- package/src/image/image.reader.spec.ts +0 -75
- package/src/instance/details/amazonInstanceInformation.component.ts +0 -13
- package/src/instance/details/instance.details.controller.js +0 -586
- package/src/instance/details/instance.details.controller.spec.js +0 -133
- package/src/instance/details/instanceDetails.html +0 -65
- package/src/instance/details/instanceDns.component.ts +0 -21
- package/src/instance/details/instanceSecurityGroups.component.ts +0 -13
- package/src/instance/details/instanceStatus.component.ts +0 -19
- package/src/instance/details/instanceTags.component.ts +0 -13
- package/src/loadBalancer/details/loadBalancerActions.component.ts +0 -16
- package/src/loadBalancer/details/loadBalancerDetails.controller.spec.ts +0 -76
- package/src/loadBalancer/details/loadBalancerDetails.controller.ts +0 -240
- package/src/loadBalancer/details/loadBalancerDetails.html +0 -266
- package/src/loadBalancer/details/targetGroupDetails.controller.ts +0 -95
- package/src/loadBalancer/details/targetGroupDetails.html +0 -138
- package/src/loadBalancer/loadBalancer.module.ts +0 -15
- package/src/loadBalancer/targetGroup.states.ts +0 -55
- package/src/pipeline/stages/bake/awsBakeStage.js +0 -219
- package/src/pipeline/stages/bake/bakeExecutionDetails.controller.js +0 -43
- package/src/pipeline/stages/bake/bakeExecutionDetails.html +0 -65
- package/src/pipeline/stages/bake/bakeStage.html +0 -205
- package/src/pipeline/stages/cloneServerGroup/awsCloneServerGroupStage.js +0 -143
- package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html +0 -143
- package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html +0 -1
- package/src/pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component.ts +0 -46
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.controller.ts +0 -84
- package/src/pipeline/stages/deployCloudFormation/deployCloudFormationStackConfig.html +0 -84
- package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +0 -9
- package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableAsg/awsDisableAsgStage.js +0 -69
- package/src/pipeline/stages/disableAsg/disableAsgStage.html +0 -11
- package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/disableCluster/awsDisableClusterStage.js +0 -84
- package/src/pipeline/stages/disableCluster/disableClusterStage.html +0 -26
- package/src/pipeline/stages/enableAsg/awsEnableAsgStage.js +0 -73
- package/src/pipeline/stages/enableAsg/enableAsgStage.html +0 -11
- package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +0 -1
- package/src/pipeline/stages/findAmi/findAmiStage.html +0 -24
- package/src/pipeline/stages/findImageFromTags/findImageFromTagsExecutionDetails.html +0 -44
- package/src/pipeline/stages/findImageFromTags/findImageFromTagsStage.html +0 -11
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessExecutionDetails.html +0 -36
- package/src/pipeline/stages/modifyScalingProcess/modifyScalingProcessStage.html +0 -24
- package/src/pipeline/stages/resizeAsg/resizeAsgStage.html +0 -90
- package/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html +0 -4
- package/src/pipeline/stages/rollbackCluster/awsRollbackClusterStage.js +0 -66
- package/src/pipeline/stages/rollbackCluster/rollbackClusterStage.html +0 -43
- package/src/pipeline/stages/scaleDownCluster/awsScaleDownClusterStage.js +0 -78
- package/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html +0 -35
- package/src/pipeline/stages/shrinkCluster/awsShrinkClusterStage.js +0 -73
- package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +0 -34
- package/src/pipeline/stages/tagImage/awsTagImageStage.js +0 -34
- package/src/pipeline/stages/tagImage/tagImageExecutionDetails.html +0 -38
- package/src/pipeline/stages/tagImage/tagImageStage.html +0 -10
- package/src/reactShims/aws.react.injector.ts +0 -25
- package/src/reactShims/aws.react.module.ts +0 -12
- package/src/reactShims/index.ts +0 -1
- package/src/securityGroup/clone/cloneSecurityGroup.controller.js +0 -106
- package/src/securityGroup/clone/cloneSecurityGroup.html +0 -19
- package/src/securityGroup/configure/CreateSecurityGroup.controller.spec.js +0 -307
- package/src/securityGroup/configure/CreateSecurityGroupCtrl.js +0 -47
- package/src/securityGroup/configure/EditSecurityGroupCtrl.js +0 -115
- package/src/securityGroup/configure/configSecurityGroup.mixin.controller.js +0 -366
- package/src/securityGroup/configure/createSecurityGroup.html +0 -19
- package/src/securityGroup/configure/createSecurityGroupIngress.html +0 -100
- package/src/securityGroup/configure/createSecurityGroupProperties.html +0 -123
- package/src/securityGroup/configure/editSecurityGroup.html +0 -20
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.html +0 -77
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.less +0 -6
- package/src/securityGroup/configure/ingressRuleGroupSelector.component.ts +0 -190
- package/src/securityGroup/configure/securityGroupDetailsCustom.component.ts +0 -16
- package/src/securityGroup/configure/securityGroupDetailsCustom.tsx +0 -16
- package/src/securityGroup/details/securityGroupDetail.controller.js +0 -249
- package/src/securityGroup/details/securityGroupDetail.html +0 -114
- package/src/securityGroup/details/securityGroupIpRangeRules.component.ts +0 -12
- package/src/securityGroup/securityGroup.module.ts +0 -26
- package/src/securityGroup/securityGroup.transformer.js +0 -48
- package/src/serverGroup/configure/serverGroupConfiguration.service.spec.ts +0 -478
- package/src/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.controller.js +0 -47
- package/src/serverGroup/details/advancedSettings/editAsgAdvancedSettings.modal.html +0 -79
- package/src/serverGroup/details/rollback/rollbackServerGroup.controller.js +0 -146
- package/src/serverGroup/details/rollback/rollbackServerGroup.html +0 -139
- package/src/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.ts +0 -15
- package/src/serverGroup/details/scalingPolicy/scalingPolicy.module.ts +0 -6
- package/src/serverGroup/details/scalingPolicy/scalingPolicySummary.component.ts +0 -14
- package/src/serverGroup/details/scalingPolicy/upsert/alarm/dimensionsEditor.less +0 -18
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.js +0 -95
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.controller.spec.js +0 -106
- package/src/serverGroup/details/scalingProcesses/modifyScalingProcesses.html +0 -30
- package/src/serverGroup/details/scheduledAction/editScheduledActions.modal.controller.js +0 -70
- package/src/serverGroup/details/scheduledAction/editScheduledActions.modal.html +0 -89
- package/src/serverGroup/details/securityGroup/editSecurityGroups.modal.controller.js +0 -95
- package/src/serverGroup/details/securityGroup/editSecurityGroups.modal.html +0 -40
- package/src/serverGroup/details/serverGroupDetails.module.ts +0 -18
- package/src/serverGroup/serverGroup.transformer.spec.ts +0 -185
- package/src/subnet/SubnetSelectInput.spec.tsx +0 -91
- package/src/subnet/subnet.renderer.ts +0 -12
- package/src/vpc/vpc.module.ts +0 -9
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { CreateApplicationLoadBalancerComponent } from './loadBalancer/configure/application/CreateApplicationLoadBalancer';
|
|
2
|
+
import { CreateClassicLoadBalancerComponent } from './loadBalancer/configure/classic/CreateClassicLoadBalancer';
|
|
3
|
+
import { CreateNetworkLoadBalancerComponent } from './loadBalancer/configure/network/CreateNetworkLoadBalancer';
|
|
4
|
+
import { CreateLambdaFunctionComponent } from './function/CreateLambdaFunction';
|
|
5
|
+
import { AmazonSecurityGroupModalComponent } from './securityGroup/configure/AmazonSecurityGroupModal';
|
|
6
|
+
import { AmazonCloneServerGroupModalComponent } from './serverGroup/configure/wizard/AmazonCloneServerGroupModal';
|
|
7
|
+
|
|
8
|
+
describe('Amazon routed modal consumers', () => {
|
|
9
|
+
function stateService(includedState: string) {
|
|
10
|
+
return {
|
|
11
|
+
go: jasmine.createSpy('go'),
|
|
12
|
+
includes: jasmine.createSpy('includes').and.callFake((state: string) => state === includedState),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
[
|
|
17
|
+
['application', CreateApplicationLoadBalancerComponent],
|
|
18
|
+
['classic', CreateClassicLoadBalancerComponent],
|
|
19
|
+
['network', CreateNetworkLoadBalancerComponent],
|
|
20
|
+
].forEach(([type, Component]: [string, any]) => {
|
|
21
|
+
it(`navigates from the ${type} load balancer modal through its injected state service`, () => {
|
|
22
|
+
const state = stateService('**.loadBalancerDetails');
|
|
23
|
+
const modal = Object.create(Component.prototype) as any;
|
|
24
|
+
modal.props = { dismissModal: jasmine.createSpy('dismissModal'), stateService: state };
|
|
25
|
+
modal.state = {};
|
|
26
|
+
modal.setState = jasmine.createSpy('setState');
|
|
27
|
+
|
|
28
|
+
modal.onApplicationRefresh({
|
|
29
|
+
credentials: 'test-account',
|
|
30
|
+
name: 'fnord-main',
|
|
31
|
+
region: 'eu-west-1',
|
|
32
|
+
vpcId: 'vpc-1',
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
expect(state.go).toHaveBeenCalledWith('^.loadBalancerDetails', {
|
|
36
|
+
accountId: 'test-account',
|
|
37
|
+
name: 'fnord-main',
|
|
38
|
+
provider: 'aws',
|
|
39
|
+
region: 'eu-west-1',
|
|
40
|
+
vpcId: 'vpc-1',
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
[
|
|
46
|
+
['application load balancer', CreateApplicationLoadBalancerComponent, 'loadBalancers'],
|
|
47
|
+
['classic load balancer', CreateClassicLoadBalancerComponent, 'loadBalancers'],
|
|
48
|
+
['network load balancer', CreateNetworkLoadBalancerComponent, 'loadBalancers'],
|
|
49
|
+
['Lambda function', CreateLambdaFunctionComponent, 'functions'],
|
|
50
|
+
].forEach(([type, Component, dataSourceName]: [string, any, string]) => {
|
|
51
|
+
it(`owns the ${type} refresh subscription across replacement and unmount`, () => {
|
|
52
|
+
const firstUnsubscribe = jasmine.createSpy('firstUnsubscribe');
|
|
53
|
+
const secondUnsubscribe = jasmine.createSpy('secondUnsubscribe');
|
|
54
|
+
const callbacks: Array<() => void> = [];
|
|
55
|
+
const onNextRefresh = jasmine.createSpy('onNextRefresh').and.callFake((callback: () => void) => {
|
|
56
|
+
callbacks.push(callback);
|
|
57
|
+
return callbacks.length === 1 ? firstUnsubscribe : secondUnsubscribe;
|
|
58
|
+
});
|
|
59
|
+
const refresh = jasmine.createSpy('refresh');
|
|
60
|
+
const state = stateService('');
|
|
61
|
+
const modal = Object.create(Component.prototype) as any;
|
|
62
|
+
modal.props = {
|
|
63
|
+
app: { [dataSourceName]: { onNextRefresh, refresh } },
|
|
64
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
65
|
+
stateService: state,
|
|
66
|
+
};
|
|
67
|
+
modal.state = {};
|
|
68
|
+
modal.setState = jasmine.createSpy('setState');
|
|
69
|
+
|
|
70
|
+
modal.onTaskComplete({});
|
|
71
|
+
|
|
72
|
+
expect(onNextRefresh.calls.first().invocationOrder).toBeLessThan(refresh.calls.first().invocationOrder);
|
|
73
|
+
|
|
74
|
+
modal.onTaskComplete({});
|
|
75
|
+
|
|
76
|
+
expect(firstUnsubscribe).toHaveBeenCalledTimes(1);
|
|
77
|
+
|
|
78
|
+
modal.componentWillUnmount();
|
|
79
|
+
callbacks[1]();
|
|
80
|
+
|
|
81
|
+
expect(secondUnsubscribe).toHaveBeenCalledTimes(1);
|
|
82
|
+
expect(modal.refreshUnsubscribe).toBeUndefined();
|
|
83
|
+
expect(state.go).not.toHaveBeenCalled();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('navigates from the function modal through its injected state service', () => {
|
|
88
|
+
const state = stateService('');
|
|
89
|
+
const modal = Object.create(CreateLambdaFunctionComponent.prototype) as any;
|
|
90
|
+
modal.props = { dismissModal: jasmine.createSpy('dismissModal'), stateService: state };
|
|
91
|
+
modal.state = {};
|
|
92
|
+
modal.setState = jasmine.createSpy('setState');
|
|
93
|
+
|
|
94
|
+
modal.onApplicationRefresh({ credentials: 'test-account', name: 'fnord', region: 'eu-west-1', vpcId: 'vpc-1' });
|
|
95
|
+
|
|
96
|
+
expect(state.go).toHaveBeenCalledWith('.functionDetails', {
|
|
97
|
+
accountId: 'test-account',
|
|
98
|
+
name: 'fnord',
|
|
99
|
+
provider: 'aws',
|
|
100
|
+
region: 'eu-west-1',
|
|
101
|
+
vpcId: 'vpc-1',
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('navigates from the security group modal through its injected state service', () => {
|
|
106
|
+
const state = stateService('**.firewallDetails');
|
|
107
|
+
const refresh = jasmine.createSpy('refresh');
|
|
108
|
+
const closeModal = jasmine.createSpy('closeModal');
|
|
109
|
+
const modal = new AmazonSecurityGroupModalComponent({
|
|
110
|
+
app: { securityGroups: { refresh } },
|
|
111
|
+
closeModal,
|
|
112
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
113
|
+
mode: 'clone',
|
|
114
|
+
stateService: state,
|
|
115
|
+
} as any) as any;
|
|
116
|
+
modal.state = {
|
|
117
|
+
securityGroup: {
|
|
118
|
+
credentials: 'test-account',
|
|
119
|
+
name: 'fnord-firewall',
|
|
120
|
+
region: 'eu-west-1',
|
|
121
|
+
vpcId: 'vpc-1',
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
modal.onTaskComplete();
|
|
126
|
+
|
|
127
|
+
expect(refresh).toHaveBeenCalled();
|
|
128
|
+
expect(closeModal).toHaveBeenCalled();
|
|
129
|
+
expect(state.go).toHaveBeenCalledWith('^.firewallDetails', {
|
|
130
|
+
accountId: 'test-account',
|
|
131
|
+
name: 'fnord-firewall',
|
|
132
|
+
provider: 'aws',
|
|
133
|
+
region: 'eu-west-1',
|
|
134
|
+
vpcId: 'vpc-1',
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
it('navigates from the clone server group modal through its injected state service', () => {
|
|
139
|
+
const state = stateService('**.clusters');
|
|
140
|
+
const modal = new AmazonCloneServerGroupModalComponent({
|
|
141
|
+
application: { name: 'fnord' },
|
|
142
|
+
command: {
|
|
143
|
+
credentials: 'test-account',
|
|
144
|
+
region: 'eu-west-1',
|
|
145
|
+
viewState: { requiresTemplateSelection: true },
|
|
146
|
+
},
|
|
147
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
148
|
+
stateService: state,
|
|
149
|
+
} as any) as any;
|
|
150
|
+
modal.state = {
|
|
151
|
+
taskMonitor: {
|
|
152
|
+
task: {
|
|
153
|
+
execution: {
|
|
154
|
+
stages: [
|
|
155
|
+
{
|
|
156
|
+
context: { 'deploy.server.groups': { 'eu-west-1': 'fnord-main-v042' } },
|
|
157
|
+
type: 'cloneServerGroup',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
modal.onApplicationRefresh();
|
|
166
|
+
|
|
167
|
+
expect(state.go).toHaveBeenCalledWith('.serverGroup', {
|
|
168
|
+
accountId: 'test-account',
|
|
169
|
+
provider: 'aws',
|
|
170
|
+
region: 'eu-west-1',
|
|
171
|
+
serverGroup: 'fnord-main-v042',
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('owns the clone server group refresh subscription across replacement and unmount', () => {
|
|
176
|
+
const firstUnsubscribe = jasmine.createSpy('firstUnsubscribe');
|
|
177
|
+
const secondUnsubscribe = jasmine.createSpy('secondUnsubscribe');
|
|
178
|
+
const callbacks: Array<() => void> = [];
|
|
179
|
+
const onNextRefresh = jasmine.createSpy('onNextRefresh').and.callFake((callback: () => void) => {
|
|
180
|
+
callbacks.push(callback);
|
|
181
|
+
return callbacks.length === 1 ? firstUnsubscribe : secondUnsubscribe;
|
|
182
|
+
});
|
|
183
|
+
const refresh = jasmine.createSpy('refresh');
|
|
184
|
+
const state = stateService('**.clusters');
|
|
185
|
+
const modal = new AmazonCloneServerGroupModalComponent({
|
|
186
|
+
application: { name: 'fnord', serverGroups: { onNextRefresh, refresh } },
|
|
187
|
+
command: { credentials: 'test-account', region: 'eu-west-1', viewState: { requiresTemplateSelection: true } },
|
|
188
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
189
|
+
stateService: state,
|
|
190
|
+
} as any) as any;
|
|
191
|
+
|
|
192
|
+
modal.onTaskComplete();
|
|
193
|
+
|
|
194
|
+
expect(onNextRefresh.calls.first().invocationOrder).toBeLessThan(refresh.calls.first().invocationOrder);
|
|
195
|
+
|
|
196
|
+
modal.onTaskComplete();
|
|
197
|
+
|
|
198
|
+
expect(firstUnsubscribe).toHaveBeenCalledTimes(1);
|
|
199
|
+
|
|
200
|
+
modal.componentWillUnmount();
|
|
201
|
+
callbacks[1]();
|
|
202
|
+
|
|
203
|
+
expect(secondUnsubscribe).toHaveBeenCalledTimes(1);
|
|
204
|
+
expect(modal.refreshUnsubscribe).toBeUndefined();
|
|
205
|
+
expect(state.go).not.toHaveBeenCalled();
|
|
206
|
+
});
|
|
207
|
+
});
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import type { ISecurityGroupSearchResult } from '@spinnaker/core';
|
|
4
|
-
import type { ISearchResultFormatter } from '@spinnaker/core';
|
|
1
|
+
import type { ISearchResultFormatter, ISecurityGroupSearchResult } from '@spinnaker/core';
|
|
5
2
|
|
|
6
3
|
import { VpcReader } from '../vpc/VpcReader';
|
|
7
4
|
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
17
|
-
} as ISearchResultFormatter,
|
|
18
|
-
};
|
|
19
|
-
});
|
|
5
|
+
export const awsSearchResultFormatter: { securityGroups: ISearchResultFormatter } = {
|
|
6
|
+
securityGroups: (entry: ISecurityGroupSearchResult) => {
|
|
7
|
+
return VpcReader.getVpcName(entry.vpcId).then((vpcName) => {
|
|
8
|
+
const region = vpcName ? entry.region + ' - ' + vpcName.toLowerCase() : entry.region;
|
|
9
|
+
return entry.name + ' (' + region + ')';
|
|
10
|
+
});
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { SecurityGroupWriter } from '@spinnaker/core';
|
|
2
|
+
import { shallow } from 'enzyme';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
AmazonSecurityGroupModalComponent as AmazonSecurityGroupModal,
|
|
7
|
+
initializeAmazonSecurityGroupForModal,
|
|
8
|
+
isAmazonSecurityGroupValid,
|
|
9
|
+
} from './AmazonSecurityGroupModal';
|
|
10
|
+
|
|
11
|
+
describe('AmazonSecurityGroupModal', () => {
|
|
12
|
+
function inferredSecurityGroup() {
|
|
13
|
+
return {
|
|
14
|
+
accountId: 'target-account-id',
|
|
15
|
+
accountName: 'target-account',
|
|
16
|
+
inboundRules: [
|
|
17
|
+
{
|
|
18
|
+
portRanges: [{ startPort: 443, endPort: 443 }],
|
|
19
|
+
protocol: 'tcp',
|
|
20
|
+
securityGroup: {
|
|
21
|
+
account: 'source-account',
|
|
22
|
+
accountId: 'source-account-id',
|
|
23
|
+
accountName: 'source-account-name',
|
|
24
|
+
id: 'sg-123456',
|
|
25
|
+
inferredName: true,
|
|
26
|
+
name: 'inferred-name',
|
|
27
|
+
vpcId: 'vpc-source',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
name: 'target-group',
|
|
32
|
+
region: 'us-east-1',
|
|
33
|
+
vpcId: 'vpc-target',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function buildModal(securityGroup: any, mode = 'edit'): any {
|
|
38
|
+
const modal = new AmazonSecurityGroupModal({
|
|
39
|
+
app: { name: 'fnord' },
|
|
40
|
+
closeModal: jasmine.createSpy('closeModal'),
|
|
41
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
42
|
+
mode,
|
|
43
|
+
securityGroup,
|
|
44
|
+
} as any) as any;
|
|
45
|
+
modal.state = {
|
|
46
|
+
...modal.state,
|
|
47
|
+
securityGroup,
|
|
48
|
+
taskMonitor: { submit: jasmine.createSpy('submit').and.callFake((method: () => any) => method()) },
|
|
49
|
+
};
|
|
50
|
+
modal.setState = (updater: any) => {
|
|
51
|
+
const nextState = typeof updater === 'function' ? updater(modal.state, modal.props) : updater;
|
|
52
|
+
modal.state = { ...modal.state, ...nextState };
|
|
53
|
+
};
|
|
54
|
+
return modal;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
it('preserves inferred source security group identity when initializing edit rules', () => {
|
|
58
|
+
const initialized = initializeAmazonSecurityGroupForModal(
|
|
59
|
+
{ mode: 'edit', securityGroup: inferredSecurityGroup() } as any,
|
|
60
|
+
'fnord',
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
expect(initialized.securityGroupIngress).toEqual([
|
|
64
|
+
{
|
|
65
|
+
account: 'source-account',
|
|
66
|
+
accountId: 'source-account-id',
|
|
67
|
+
accountName: 'source-account-name',
|
|
68
|
+
endPort: 443,
|
|
69
|
+
existing: true,
|
|
70
|
+
id: 'sg-123456',
|
|
71
|
+
name: null,
|
|
72
|
+
startPort: 443,
|
|
73
|
+
type: 'tcp',
|
|
74
|
+
vpcId: 'vpc-source',
|
|
75
|
+
},
|
|
76
|
+
]);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('accepts existing source security group rules identified by either name or id', () => {
|
|
80
|
+
const securityGroup = initializeAmazonSecurityGroupForModal(
|
|
81
|
+
{ mode: 'edit', securityGroup: inferredSecurityGroup() } as any,
|
|
82
|
+
'fnord',
|
|
83
|
+
);
|
|
84
|
+
const rule = securityGroup.securityGroupIngress[0];
|
|
85
|
+
|
|
86
|
+
expect(isAmazonSecurityGroupValid(securityGroup)).toBe(true);
|
|
87
|
+
expect(
|
|
88
|
+
isAmazonSecurityGroupValid({
|
|
89
|
+
...securityGroup,
|
|
90
|
+
securityGroupIngress: [{ ...rule, id: undefined, name: 'named-source-group' }],
|
|
91
|
+
}),
|
|
92
|
+
).toBe(true);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('renders existing identity immutably, allows protocol and port edits, and submits the retained identity', () => {
|
|
96
|
+
spyOn(SecurityGroupWriter, 'upsertSecurityGroup').and.returnValue(Promise.resolve({} as any));
|
|
97
|
+
const securityGroup = initializeAmazonSecurityGroupForModal(
|
|
98
|
+
{ mode: 'edit', securityGroup: inferredSecurityGroup() } as any,
|
|
99
|
+
'fnord',
|
|
100
|
+
);
|
|
101
|
+
const modal = buildModal(securityGroup);
|
|
102
|
+
const wrapper = shallow(<div>{modal.renderSecurityGroupRules()}</div>);
|
|
103
|
+
const inputs = wrapper.find('input');
|
|
104
|
+
|
|
105
|
+
expect(wrapper.text()).toContain('sg-123456');
|
|
106
|
+
expect(inputs.length).toBe(3);
|
|
107
|
+
expect(inputs.someWhere((input) => input.prop('value') === 'sg-123456')).toBe(false);
|
|
108
|
+
|
|
109
|
+
inputs.at(0).simulate('change', { target: { value: 'udp' } });
|
|
110
|
+
inputs.at(1).simulate('change', { target: { value: '8443' } });
|
|
111
|
+
inputs.at(2).simulate('change', { target: { value: '9443' } });
|
|
112
|
+
modal.submit();
|
|
113
|
+
|
|
114
|
+
const submittedRule = (SecurityGroupWriter.upsertSecurityGroup as jasmine.Spy).calls.mostRecent().args[0]
|
|
115
|
+
.securityGroupIngress[0];
|
|
116
|
+
expect(submittedRule).toEqual({
|
|
117
|
+
account: 'source-account',
|
|
118
|
+
accountId: 'source-account-id',
|
|
119
|
+
accountName: 'source-account-name',
|
|
120
|
+
endPort: 9443,
|
|
121
|
+
existing: true,
|
|
122
|
+
id: 'sg-123456',
|
|
123
|
+
name: null,
|
|
124
|
+
startPort: 8443,
|
|
125
|
+
type: 'udp',
|
|
126
|
+
vpcId: 'vpc-source',
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('submits cloned rules by their editable name without stale source identity', () => {
|
|
131
|
+
spyOn(SecurityGroupWriter, 'upsertSecurityGroup').and.returnValue(Promise.resolve({} as any));
|
|
132
|
+
const source = inferredSecurityGroup();
|
|
133
|
+
source.inboundRules[0].securityGroup.inferredName = false;
|
|
134
|
+
source.inboundRules[0].securityGroup.name = 'resolved-source-group';
|
|
135
|
+
const securityGroup = initializeAmazonSecurityGroupForModal(
|
|
136
|
+
{ mode: 'clone', securityGroup: source } as any,
|
|
137
|
+
'fnord',
|
|
138
|
+
);
|
|
139
|
+
const modal = buildModal(securityGroup, 'clone');
|
|
140
|
+
const wrapper = shallow(<div>{modal.renderSecurityGroupRules()}</div>);
|
|
141
|
+
const nameInput = wrapper.find('input').at(0);
|
|
142
|
+
|
|
143
|
+
expect(nameInput.prop('value')).toBe('resolved-source-group');
|
|
144
|
+
|
|
145
|
+
nameInput.simulate('change', { target: { value: 'cloned-source-group' } });
|
|
146
|
+
modal.submit();
|
|
147
|
+
|
|
148
|
+
const submittedRule = (SecurityGroupWriter.upsertSecurityGroup as jasmine.Spy).calls.mostRecent().args[0]
|
|
149
|
+
.securityGroupIngress[0];
|
|
150
|
+
expect(submittedRule).toEqual({
|
|
151
|
+
endPort: 443,
|
|
152
|
+
name: 'cloned-source-group',
|
|
153
|
+
startPort: 443,
|
|
154
|
+
type: 'tcp',
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('requires an inferred source group to be replaced by name when cloning', () => {
|
|
159
|
+
const source = inferredSecurityGroup();
|
|
160
|
+
source.inboundRules[0].securityGroup.name = 'sg-123456';
|
|
161
|
+
|
|
162
|
+
const securityGroup = initializeAmazonSecurityGroupForModal(
|
|
163
|
+
{ mode: 'clone', securityGroup: source } as any,
|
|
164
|
+
'fnord',
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
expect(securityGroup.securityGroupIngress[0].name).toBeNull();
|
|
168
|
+
expect(isAmazonSecurityGroupValid(securityGroup)).toBe(false);
|
|
169
|
+
});
|
|
170
|
+
});
|