@spinnaker/amazon 2026.2.3 → 2026.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { get } from 'lodash';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Dropdown, MenuItem, Tooltip } from 'react-bootstrap';
|
|
4
4
|
|
|
5
|
-
import type { IOwnerOption, IServerGroupActionsProps, IServerGroupJob } from '@spinnaker/core';
|
|
5
|
+
import type { IOwnerOption, IRouterInjectedProps, IServerGroupActionsProps, IServerGroupJob } from '@spinnaker/core';
|
|
6
6
|
import {
|
|
7
7
|
AddEntityTagLinks,
|
|
8
8
|
ClusterTargetBuilder,
|
|
9
9
|
ConfirmationModalService,
|
|
10
|
+
DeckRuntimeContext,
|
|
10
11
|
ManagedMenuItem,
|
|
11
|
-
ModalInjector,
|
|
12
12
|
Overridable,
|
|
13
|
-
ReactInjector,
|
|
14
13
|
ServerGroupWarningMessageService,
|
|
15
14
|
SETTINGS,
|
|
15
|
+
withRouter,
|
|
16
16
|
} from '@spinnaker/core';
|
|
17
17
|
|
|
18
18
|
import { AWSProviderSettings } from '../../aws.settings';
|
|
19
19
|
import type { IAmazonServerGroupCommand } from '../configure';
|
|
20
20
|
import { AmazonCloneServerGroupModal } from '../configure/wizard/AmazonCloneServerGroupModal';
|
|
21
21
|
import type { IAmazonServerGroup, IAmazonServerGroupView } from '../../domain';
|
|
22
|
-
import { AwsReactInjector } from '../../reactShims';
|
|
23
22
|
import type { IAmazonResizeServerGroupModalProps } from './resize/AmazonResizeServerGroupModal';
|
|
24
23
|
import { AmazonResizeServerGroupModal } from './resize/AmazonResizeServerGroupModal';
|
|
24
|
+
import {
|
|
25
|
+
AmazonRollbackServerGroupModal,
|
|
26
|
+
isAmazonRollbackAvailable,
|
|
27
|
+
selectAmazonRollbackServerGroups,
|
|
28
|
+
} from './rollback';
|
|
25
29
|
|
|
26
30
|
export interface IAmazonServerGroupActionsProps extends IServerGroupActionsProps {
|
|
27
31
|
serverGroup: IAmazonServerGroupView;
|
|
@@ -29,8 +33,11 @@ export interface IAmazonServerGroupActionsProps extends IServerGroupActionsProps
|
|
|
29
33
|
|
|
30
34
|
@Overridable('AmazonServerGroupActions.resize')
|
|
31
35
|
export class AmazonServerGroupActionsResize extends React.Component<IAmazonResizeServerGroupModalProps> {
|
|
36
|
+
public static contextType = DeckRuntimeContext;
|
|
37
|
+
public declare context: React.ContextType<typeof DeckRuntimeContext>;
|
|
38
|
+
|
|
32
39
|
private resizeServerGroup = (): void => {
|
|
33
|
-
AmazonResizeServerGroupModal.show(this.props);
|
|
40
|
+
AmazonResizeServerGroupModal.show(this.props, this.context.services);
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
public render(): JSX.Element {
|
|
@@ -38,7 +45,12 @@ export class AmazonServerGroupActionsResize extends React.Component<IAmazonResiz
|
|
|
38
45
|
}
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
export class
|
|
48
|
+
export class AmazonServerGroupActionsComponent extends React.Component<
|
|
49
|
+
IAmazonServerGroupActionsProps & IRouterInjectedProps
|
|
50
|
+
> {
|
|
51
|
+
public static contextType = DeckRuntimeContext;
|
|
52
|
+
public declare context: React.ContextType<typeof DeckRuntimeContext>;
|
|
53
|
+
|
|
42
54
|
private isEnableLocked(): boolean {
|
|
43
55
|
if (this.props.serverGroup.isDisabled) {
|
|
44
56
|
const resizeTasks = (this.props.serverGroup.runningTasks || []).filter((task) =>
|
|
@@ -53,22 +65,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
53
65
|
|
|
54
66
|
private isRollbackEnabled(): boolean {
|
|
55
67
|
const { app, serverGroup } = this.props;
|
|
56
|
-
|
|
57
|
-
if (!serverGroup.isDisabled) {
|
|
58
|
-
// enabled server groups are always a candidate for rollback
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// if the server group selected for rollback is disabled, ensure that at least one enabled server group exists
|
|
63
|
-
return app
|
|
64
|
-
.getDataSource('serverGroups')
|
|
65
|
-
.data.some(
|
|
66
|
-
(g: IAmazonServerGroup) =>
|
|
67
|
-
g.cluster === serverGroup.cluster &&
|
|
68
|
-
g.region === serverGroup.region &&
|
|
69
|
-
g.account === serverGroup.account &&
|
|
70
|
-
!g.isDisabled,
|
|
71
|
-
);
|
|
68
|
+
return isAmazonRollbackAvailable(app.name, serverGroup, app.getDataSource('serverGroups').data);
|
|
72
69
|
}
|
|
73
70
|
|
|
74
71
|
private hasDisabledInstances(): boolean {
|
|
@@ -83,14 +80,14 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
83
80
|
application: app,
|
|
84
81
|
title: 'Destroying ' + serverGroup.name,
|
|
85
82
|
onTaskComplete: () => {
|
|
86
|
-
if (
|
|
87
|
-
|
|
83
|
+
if (this.props.stateService.includes('**.serverGroup', stateParams)) {
|
|
84
|
+
this.props.stateService.go('^');
|
|
88
85
|
}
|
|
89
86
|
},
|
|
90
87
|
};
|
|
91
88
|
|
|
92
89
|
const submitMethod = (params: IServerGroupJob) =>
|
|
93
|
-
|
|
90
|
+
this.context.services.serverGroupWriter.destroyServerGroup(serverGroup, app, params);
|
|
94
91
|
|
|
95
92
|
const stateParams = {
|
|
96
93
|
name: serverGroup.name,
|
|
@@ -128,7 +125,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
128
125
|
};
|
|
129
126
|
|
|
130
127
|
const submitMethod = (params: IServerGroupJob) => {
|
|
131
|
-
return
|
|
128
|
+
return this.context.services.serverGroupWriter.disableServerGroup(serverGroup, app.name, params);
|
|
132
129
|
};
|
|
133
130
|
|
|
134
131
|
const confirmationModalParams = {
|
|
@@ -167,9 +164,6 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
167
164
|
};
|
|
168
165
|
|
|
169
166
|
ConfirmationModalService.confirm(confirmationModalParams)
|
|
170
|
-
// Wait for the confirmation modal to go away first to avoid react/angular bootstrap fighting
|
|
171
|
-
// over the body.modal-open class
|
|
172
|
-
.then(() => new Promise((resolve) => setTimeout(resolve, 500)))
|
|
173
167
|
.then(() => this.rollbackServerGroup())
|
|
174
168
|
.catch((error) => {
|
|
175
169
|
// don't show the enable modal if the user cancels with the header button
|
|
@@ -188,7 +182,7 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
188
182
|
};
|
|
189
183
|
|
|
190
184
|
const submitMethod = (params: IServerGroupJob) => {
|
|
191
|
-
return
|
|
185
|
+
return this.context.services.serverGroupWriter.enableServerGroup(serverGroup, app, params);
|
|
192
186
|
};
|
|
193
187
|
|
|
194
188
|
const confirmationModalParams = {
|
|
@@ -211,71 +205,25 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
211
205
|
}
|
|
212
206
|
|
|
213
207
|
private rollbackServerGroup = (): void => {
|
|
214
|
-
const { app } = this.props;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
.data.filter(
|
|
221
|
-
(g: IAmazonServerGroup) =>
|
|
222
|
-
g.cluster === serverGroup.cluster && g.region === serverGroup.region && g.account === serverGroup.account,
|
|
223
|
-
);
|
|
224
|
-
|
|
225
|
-
if (serverGroup.isDisabled) {
|
|
226
|
-
// if the selected server group is disabled, it represents the server group that should be _rolled back to_
|
|
227
|
-
previousServerGroup = serverGroup;
|
|
228
|
-
|
|
229
|
-
/*
|
|
230
|
-
* Find an existing server group to rollback, prefer the largest enabled server group.
|
|
231
|
-
*
|
|
232
|
-
* isRollbackEnabled() ensures that at least one enabled server group exists.
|
|
233
|
-
*/
|
|
234
|
-
serverGroup = orderBy(
|
|
235
|
-
allServerGroups.filter((g: IAmazonServerGroup) => g.name !== previousServerGroup.name && !g.isDisabled),
|
|
236
|
-
['instanceCounts.total', 'createdTime'],
|
|
237
|
-
['desc', 'desc'],
|
|
238
|
-
)[0] as IAmazonServerGroup;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
// the set of all server groups should not include the server group selected for rollback
|
|
242
|
-
allServerGroups = allServerGroups.filter((g: IAmazonServerGroup) => g.name !== serverGroup.name);
|
|
208
|
+
const { app, serverGroup } = this.props;
|
|
209
|
+
const selection = selectAmazonRollbackServerGroups(
|
|
210
|
+
app.name,
|
|
211
|
+
serverGroup,
|
|
212
|
+
app.getDataSource('serverGroups').data as IAmazonServerGroup[],
|
|
213
|
+
);
|
|
243
214
|
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
previousServerGroup = allServerGroups[0];
|
|
215
|
+
if (selection) {
|
|
216
|
+
AmazonRollbackServerGroupModal.show({ application: app, ...selection }, this.context.services);
|
|
247
217
|
}
|
|
248
|
-
|
|
249
|
-
ModalInjector.modalService.open({
|
|
250
|
-
templateUrl: ReactInjector.overrideRegistry.getTemplate(
|
|
251
|
-
'aws.rollback.modal',
|
|
252
|
-
require('./rollback/rollbackServerGroup.html'),
|
|
253
|
-
),
|
|
254
|
-
controller: 'awsRollbackServerGroupCtrl as ctrl',
|
|
255
|
-
resolve: {
|
|
256
|
-
serverGroup: () => serverGroup,
|
|
257
|
-
previousServerGroup: () => previousServerGroup,
|
|
258
|
-
disabledServerGroups: () => {
|
|
259
|
-
const cluster = find(app.clusters, {
|
|
260
|
-
name: serverGroup.cluster,
|
|
261
|
-
account: serverGroup.account,
|
|
262
|
-
serverGroups: [],
|
|
263
|
-
});
|
|
264
|
-
return filter(cluster.serverGroups, { isDisabled: true, region: serverGroup.region });
|
|
265
|
-
},
|
|
266
|
-
allServerGroups: () => allServerGroups,
|
|
267
|
-
application: () => app,
|
|
268
|
-
},
|
|
269
|
-
});
|
|
270
218
|
};
|
|
271
219
|
|
|
272
220
|
private cloneServerGroup = (): void => {
|
|
273
221
|
const { app, serverGroup } = this.props;
|
|
274
|
-
|
|
222
|
+
this.context.services.serverGroupCommandBuilder
|
|
275
223
|
.buildServerGroupCommandFromExisting(app, serverGroup)
|
|
276
224
|
.then((command: IAmazonServerGroupCommand) => {
|
|
277
225
|
const title = `Clone ${serverGroup.name}`;
|
|
278
|
-
AmazonCloneServerGroupModal.show({ title, application: app, command });
|
|
226
|
+
AmazonCloneServerGroupModal.show({ title, application: app, command }, this.context.services);
|
|
279
227
|
});
|
|
280
228
|
};
|
|
281
229
|
|
|
@@ -341,3 +289,5 @@ export class AmazonServerGroupActions extends React.Component<IAmazonServerGroup
|
|
|
341
289
|
);
|
|
342
290
|
}
|
|
343
291
|
}
|
|
292
|
+
|
|
293
|
+
export const AmazonServerGroupActions = withRouter(AmazonServerGroupActionsComponent);
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { mount, shallow } from 'enzyme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { DeckRuntimeContext, FormikFormField, ReactModal, TaskMonitorModal } from '@spinnaker/core';
|
|
5
|
+
|
|
6
|
+
import { EditAsgAdvancedSettingsModal } from './EditAsgAdvancedSettingsModal';
|
|
7
|
+
|
|
8
|
+
describe('EditAsgAdvancedSettingsModal', () => {
|
|
9
|
+
const application = { name: 'deck', serverGroups: { refresh: jasmine.createSpy('refresh') } } as any;
|
|
10
|
+
const serverGroup = { name: 'deck-main-v001', account: 'test', region: 'us-east-1' } as any;
|
|
11
|
+
let buildUpdateServerGroupCommand: jasmine.Spy;
|
|
12
|
+
const modalProps = {
|
|
13
|
+
application,
|
|
14
|
+
serverGroup,
|
|
15
|
+
closeModal: jasmine.createSpy('closeModal'),
|
|
16
|
+
dismissModal: jasmine.createSpy('dismissModal'),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
function mountModal(command: any) {
|
|
20
|
+
buildUpdateServerGroupCommand = jasmine.createSpy().and.returnValue(command);
|
|
21
|
+
const commandBuilder = { buildUpdateServerGroupCommand };
|
|
22
|
+
const runtime = {
|
|
23
|
+
services: { providerServiceDelegate: { getDelegate: jasmine.createSpy().and.returnValue(commandBuilder) } },
|
|
24
|
+
} as any;
|
|
25
|
+
return mount(
|
|
26
|
+
<DeckRuntimeContext.Provider value={runtime}>
|
|
27
|
+
<EditAsgAdvancedSettingsModal {...modalProps} />
|
|
28
|
+
</DeckRuntimeContext.Provider>,
|
|
29
|
+
).find(EditAsgAdvancedSettingsModal);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
it('builds one update command and preserves it across rerenders', () => {
|
|
33
|
+
const command = {
|
|
34
|
+
backingData: { enabledMetrics: [], healthCheckTypes: [], terminationPolicies: [] },
|
|
35
|
+
} as any;
|
|
36
|
+
const wrapper = mountModal(command);
|
|
37
|
+
const initialValues = wrapper.find(TaskMonitorModal).prop('initialValues');
|
|
38
|
+
|
|
39
|
+
wrapper.instance().forceUpdate();
|
|
40
|
+
wrapper.update();
|
|
41
|
+
|
|
42
|
+
expect(buildUpdateServerGroupCommand).toHaveBeenCalledTimes(1);
|
|
43
|
+
expect(wrapper.find(TaskMonitorModal).prop('initialValues')).toBe(initialValues);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('uses the update command builder and exposes every advanced setting', () => {
|
|
47
|
+
const command = {
|
|
48
|
+
cooldown: 10,
|
|
49
|
+
enabledMetrics: ['GroupDesiredCapacity'],
|
|
50
|
+
healthCheckGracePeriod: 600,
|
|
51
|
+
healthCheckType: 'EC2',
|
|
52
|
+
terminationPolicies: ['Default'],
|
|
53
|
+
capacityRebalance: false,
|
|
54
|
+
backingData: {
|
|
55
|
+
enabledMetrics: ['GroupDesiredCapacity'],
|
|
56
|
+
healthCheckTypes: ['EC2', 'ELB'],
|
|
57
|
+
terminationPolicies: ['Default'],
|
|
58
|
+
},
|
|
59
|
+
} as any;
|
|
60
|
+
const wrapper = mountModal(command);
|
|
61
|
+
const taskModal = wrapper.find(TaskMonitorModal);
|
|
62
|
+
|
|
63
|
+
expect(taskModal.prop('initialValues')).toBe(command);
|
|
64
|
+
expect(taskModal.prop('mapValuesToTask')(command)).toEqual({ application, job: [command] });
|
|
65
|
+
|
|
66
|
+
const fields = shallow(<div>{taskModal.prop('render')({ values: command } as any)}</div>).find(FormikFormField);
|
|
67
|
+
expect(fields.map((field) => field.prop('name'))).toEqual([
|
|
68
|
+
'cooldown',
|
|
69
|
+
'enabledMetrics',
|
|
70
|
+
'healthCheckType',
|
|
71
|
+
'healthCheckGracePeriod',
|
|
72
|
+
'terminationPolicies',
|
|
73
|
+
'capacityRebalance',
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('requires finite non-negative cooldown and health check grace period values', () => {
|
|
78
|
+
const command = {
|
|
79
|
+
cooldown: 10,
|
|
80
|
+
healthCheckGracePeriod: 600,
|
|
81
|
+
backingData: { enabledMetrics: [], healthCheckTypes: [], terminationPolicies: [] },
|
|
82
|
+
} as any;
|
|
83
|
+
const wrapper = mountModal(command);
|
|
84
|
+
const taskModal = wrapper.find(TaskMonitorModal);
|
|
85
|
+
const fields = shallow(<div>{taskModal.prop('render')({ values: command } as any)}</div>).find(FormikFormField);
|
|
86
|
+
|
|
87
|
+
['cooldown', 'healthCheckGracePeriod'].forEach((name) => {
|
|
88
|
+
const field = fields.filterWhere((candidate) => candidate.prop('name') === name);
|
|
89
|
+
const validate = field.prop('validate') as (value: unknown) => string | undefined;
|
|
90
|
+
|
|
91
|
+
expect(field.prop('required')).toBe(true);
|
|
92
|
+
[undefined, null, '', NaN, Infinity, -Infinity, -1].forEach((value) => expect(validate(value)).toBeDefined());
|
|
93
|
+
[0, 0.5, 1].forEach((value) => expect(validate(value)).toBeUndefined());
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('opens only after managed-resource verification succeeds', async () => {
|
|
98
|
+
const show = spyOn(ReactModal, 'show').and.returnValue(Promise.resolve() as any);
|
|
99
|
+
const runtimeServices = {} as any;
|
|
100
|
+
|
|
101
|
+
await EditAsgAdvancedSettingsModal.show({ application, serverGroup }, runtimeServices);
|
|
102
|
+
|
|
103
|
+
expect(show).toHaveBeenCalledWith(
|
|
104
|
+
EditAsgAdvancedSettingsModal,
|
|
105
|
+
{ application, serverGroup },
|
|
106
|
+
{ dialogClassName: 'modal-lg' },
|
|
107
|
+
runtimeServices,
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { FormikProps } from 'formik';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import type { Application, DeckRuntimeServices, IModalComponentProps } from '@spinnaker/core';
|
|
5
|
+
import {
|
|
6
|
+
CheckboxInput,
|
|
7
|
+
confirmNotManaged,
|
|
8
|
+
DeckRuntimeContext,
|
|
9
|
+
FormikFormField,
|
|
10
|
+
HelpField,
|
|
11
|
+
NumberInput,
|
|
12
|
+
ReactModal,
|
|
13
|
+
ReactSelectInput,
|
|
14
|
+
TaskMonitorModal,
|
|
15
|
+
} from '@spinnaker/core';
|
|
16
|
+
|
|
17
|
+
import type { AwsServerGroupCommandBuilder } from '../../configure/serverGroupCommandBuilder.service';
|
|
18
|
+
import type { IAmazonServerGroupCommand } from '../../configure/serverGroupConfiguration.service';
|
|
19
|
+
import type { IAmazonServerGroup } from '../../../domain';
|
|
20
|
+
|
|
21
|
+
export interface IEditAsgAdvancedSettingsModalProps extends IModalComponentProps {
|
|
22
|
+
application: Application;
|
|
23
|
+
serverGroup: IAmazonServerGroup;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function validateRequiredNonNegativeNumber(value: unknown): string | undefined {
|
|
27
|
+
return typeof value !== 'number' || !Number.isFinite(value) || value < 0
|
|
28
|
+
? 'Enter a finite non-negative number'
|
|
29
|
+
: undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export class EditAsgAdvancedSettingsModal extends React.Component<IEditAsgAdvancedSettingsModalProps> {
|
|
33
|
+
public static contextType = DeckRuntimeContext;
|
|
34
|
+
public declare context: React.ContextType<typeof DeckRuntimeContext>;
|
|
35
|
+
|
|
36
|
+
private directCommand: Partial<IAmazonServerGroupCommand>;
|
|
37
|
+
|
|
38
|
+
public static show(props: IEditAsgAdvancedSettingsModalProps, runtimeServices: DeckRuntimeServices) {
|
|
39
|
+
return confirmNotManaged(props.serverGroup, props.application).then(
|
|
40
|
+
(notManaged) =>
|
|
41
|
+
notManaged &&
|
|
42
|
+
ReactModal.show(EditAsgAdvancedSettingsModal, props, { dialogClassName: 'modal-lg' }, runtimeServices),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private get command(): Partial<IAmazonServerGroupCommand> {
|
|
47
|
+
return (this.directCommand ||= this.context.services.providerServiceDelegate
|
|
48
|
+
.getDelegate<AwsServerGroupCommandBuilder>('aws', 'serverGroup.commandBuilder')
|
|
49
|
+
.buildUpdateServerGroupCommand(this.props.serverGroup));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
private renderFields = (formik: FormikProps<IAmazonServerGroupCommand>) => {
|
|
53
|
+
const { backingData } = formik.values;
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<FormikFormField
|
|
57
|
+
label="Cooldown"
|
|
58
|
+
name="cooldown"
|
|
59
|
+
help="Seconds"
|
|
60
|
+
input={(props) => <NumberInput {...props} min={0} />}
|
|
61
|
+
required={true}
|
|
62
|
+
validate={validateRequiredNonNegativeNumber}
|
|
63
|
+
/>
|
|
64
|
+
<FormikFormField
|
|
65
|
+
label="Enabled Metrics"
|
|
66
|
+
name="enabledMetrics"
|
|
67
|
+
help={<HelpField id="aws.serverGroup.enabledMetrics" />}
|
|
68
|
+
input={(props) => <ReactSelectInput {...props} multi={true} stringOptions={backingData.enabledMetrics} />}
|
|
69
|
+
/>
|
|
70
|
+
<FormikFormField
|
|
71
|
+
label="Health Check Type"
|
|
72
|
+
name="healthCheckType"
|
|
73
|
+
input={(props) => (
|
|
74
|
+
<ReactSelectInput {...props} clearable={false} stringOptions={backingData.healthCheckTypes} />
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
<FormikFormField
|
|
78
|
+
label="Health Check Grace Period"
|
|
79
|
+
name="healthCheckGracePeriod"
|
|
80
|
+
help="Seconds"
|
|
81
|
+
input={(props) => <NumberInput {...props} min={0} />}
|
|
82
|
+
required={true}
|
|
83
|
+
validate={validateRequiredNonNegativeNumber}
|
|
84
|
+
/>
|
|
85
|
+
<FormikFormField
|
|
86
|
+
label="Termination Policies"
|
|
87
|
+
name="terminationPolicies"
|
|
88
|
+
input={(props) => (
|
|
89
|
+
<ReactSelectInput {...props} multi={true} stringOptions={backingData.terminationPolicies} />
|
|
90
|
+
)}
|
|
91
|
+
/>
|
|
92
|
+
<FormikFormField
|
|
93
|
+
label="Capacity Rebalance"
|
|
94
|
+
name="capacityRebalance"
|
|
95
|
+
help={<HelpField id="aws.serverGroup.capacityRebalance" />}
|
|
96
|
+
input={(props) => <CheckboxInput {...props} text="Enable capacity rebalance" />}
|
|
97
|
+
/>
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
public render() {
|
|
103
|
+
const { application, closeModal, dismissModal, serverGroup } = this.props;
|
|
104
|
+
return (
|
|
105
|
+
<TaskMonitorModal<IAmazonServerGroupCommand>
|
|
106
|
+
application={application}
|
|
107
|
+
closeModal={closeModal}
|
|
108
|
+
description={`Update Advanced Settings for ${serverGroup.name}`}
|
|
109
|
+
dismissModal={dismissModal}
|
|
110
|
+
initialValues={this.command as IAmazonServerGroupCommand}
|
|
111
|
+
mapValuesToTask={(command) => ({ application, job: [command] })}
|
|
112
|
+
render={this.renderFields}
|
|
113
|
+
title={`Edit Advanced Settings for ${serverGroup.name}`}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './EditAsgAdvancedSettingsModal';
|
|
@@ -3,12 +3,12 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
|
|
4
4
|
import type { IServerGroupDetailsProps, ISubnet } from '@spinnaker/core';
|
|
5
5
|
import { AccountService, ServerGroupReader, SubnetReader } from '@spinnaker/core';
|
|
6
|
-
import type { IAmazonLoadBalancer, IAmazonServerGroup, IAmazonServerGroupView } from '../../domain';
|
|
7
|
-
import { AwsReactInjector } from '../../reactShims';
|
|
8
6
|
|
|
7
|
+
import { AwsServices } from '../../aws.services';
|
|
8
|
+
import type { IAmazonLoadBalancer, IAmazonServerGroup, IAmazonServerGroupView } from '../../domain';
|
|
9
9
|
import { AutoScalingProcessService } from './scalingProcesses/AutoScalingProcessService';
|
|
10
10
|
|
|
11
|
-
function extractServerGroupSummary(props: IServerGroupDetailsProps):
|
|
11
|
+
function extractServerGroupSummary(props: IServerGroupDetailsProps): Promise<IAmazonServerGroup> {
|
|
12
12
|
const { app, serverGroup } = props;
|
|
13
13
|
return app.ready().then(() => {
|
|
14
14
|
let summary: IAmazonServerGroup = app.serverGroups.data.find((toCheck: IAmazonServerGroup) => {
|
|
@@ -52,7 +52,7 @@ export function amazonServerGroupDetailsGetter(
|
|
|
52
52
|
// it's possible the summary was not found because the clusters are still loading
|
|
53
53
|
Object.assign(details, summary, { account: serverGroupInfo.accountId });
|
|
54
54
|
|
|
55
|
-
const serverGroup =
|
|
55
|
+
const serverGroup = AwsServices.awsServerGroupTransformer.normalizeServerGroupDetails(details);
|
|
56
56
|
|
|
57
57
|
AccountService.getAccountDetails(serverGroup.account).then((accountDetails) => {
|
|
58
58
|
serverGroup.accountDetails = accountDetails;
|
|
@@ -4,10 +4,17 @@ import { pickBy } from 'lodash';
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Modal } from 'react-bootstrap';
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
Application,
|
|
9
|
+
DeckRuntimeServices,
|
|
10
|
+
ICapacity,
|
|
11
|
+
IModalComponentProps,
|
|
12
|
+
IServerGroupJob,
|
|
13
|
+
} from '@spinnaker/core';
|
|
8
14
|
import {
|
|
9
15
|
CheckboxInput,
|
|
10
16
|
confirmNotManaged,
|
|
17
|
+
DeckRuntimeContext,
|
|
11
18
|
FormikFormField,
|
|
12
19
|
HelpField,
|
|
13
20
|
MinMaxDesiredChanges,
|
|
@@ -15,7 +22,6 @@ import {
|
|
|
15
22
|
noop,
|
|
16
23
|
NumberInput,
|
|
17
24
|
PlatformHealthOverride,
|
|
18
|
-
ReactInjector,
|
|
19
25
|
ReactModal,
|
|
20
26
|
SpinFormik,
|
|
21
27
|
TaskMonitor,
|
|
@@ -23,6 +29,7 @@ import {
|
|
|
23
29
|
TaskReason,
|
|
24
30
|
ValidationMessage,
|
|
25
31
|
} from '@spinnaker/core';
|
|
32
|
+
|
|
26
33
|
import { AwsModalFooter } from '../../../common';
|
|
27
34
|
import type { IAmazonServerGroup } from '../../../domain';
|
|
28
35
|
|
|
@@ -57,6 +64,9 @@ export class AmazonResizeServerGroupModal extends React.Component<
|
|
|
57
64
|
IAmazonResizeServerGroupModalProps,
|
|
58
65
|
IAmazonResizeServerGroupModalState
|
|
59
66
|
> {
|
|
67
|
+
public static contextType = DeckRuntimeContext;
|
|
68
|
+
public declare context: React.ContextType<typeof DeckRuntimeContext>;
|
|
69
|
+
|
|
60
70
|
public static defaultProps: Partial<IAmazonResizeServerGroupModalProps> = {
|
|
61
71
|
closeModal: noop,
|
|
62
72
|
dismissModal: noop,
|
|
@@ -64,11 +74,11 @@ export class AmazonResizeServerGroupModal extends React.Component<
|
|
|
64
74
|
|
|
65
75
|
private formikRef = React.createRef<Formik<IAmazonResizeServerGroupValues>>();
|
|
66
76
|
|
|
67
|
-
public static show(props: IAmazonResizeServerGroupModalProps) {
|
|
77
|
+
public static show(props: IAmazonResizeServerGroupModalProps, runtimeServices: DeckRuntimeServices) {
|
|
68
78
|
const modalProps = {};
|
|
69
79
|
const { serverGroup, application } = props;
|
|
70
80
|
return confirmNotManaged(serverGroup, application).then((notManaged) => {
|
|
71
|
-
notManaged && ReactModal.show(AmazonResizeServerGroupModal, props, modalProps);
|
|
81
|
+
notManaged && ReactModal.show(AmazonResizeServerGroupModal, props, modalProps, runtimeServices);
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
84
|
|
|
@@ -88,7 +98,7 @@ export class AmazonResizeServerGroupModal extends React.Component<
|
|
|
88
98
|
taskMonitor: new TaskMonitor({
|
|
89
99
|
application: props.application,
|
|
90
100
|
title: 'Resizing your server group',
|
|
91
|
-
|
|
101
|
+
onDismiss: () => this.props.dismissModal(),
|
|
92
102
|
onTaskComplete: () => this.props.application.serverGroups.refresh(),
|
|
93
103
|
}),
|
|
94
104
|
platformHealthOnlyShowOverride: attributes.platformHealthOnlyShowOverride,
|
|
@@ -199,7 +209,7 @@ export class AmazonResizeServerGroupModal extends React.Component<
|
|
|
199
209
|
};
|
|
200
210
|
}
|
|
201
211
|
this.state.taskMonitor.submit(() => {
|
|
202
|
-
return
|
|
212
|
+
return this.context.services.serverGroupWriter.resizeServerGroup(serverGroup, application, command);
|
|
203
213
|
});
|
|
204
214
|
};
|
|
205
215
|
|