Skip to content

Commit

Permalink
fix(lambdaStages): Exporting Lambda stages based on the feature flag …
Browse files Browse the repository at this point in the history
…settings (#10085)

Co-authored-by: Jason <jason.mcintosh@armory.io>
Co-authored-by: ovidiupopa07 <105648914+ovidiupopa07@users.noreply.github.com>
  • Loading branch information
3 people committed Apr 25, 2024
1 parent 4e1635d commit 93bab65
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 49 deletions.
8 changes: 8 additions & 0 deletions packages/amazon/src/aws.module.ts
Expand Up @@ -26,22 +26,26 @@ import { AWS_LOAD_BALANCER_MODULE } from './loadBalancer/loadBalancer.module';
import amazonLogo from './logo/amazon.logo.svg';
import { AMAZON_PIPELINE_STAGES_BAKE_AWSBAKESTAGE } from './pipeline/stages/bake/awsBakeStage';
import { AMAZON_PIPELINE_STAGES_CLONESERVERGROUP_AWSCLONESERVERGROUPSTAGE } from './pipeline/stages/cloneServerGroup/awsCloneServerGroupStage';
import { AMAZON_PIPELINE_STAGES_LAMBDA_DELETE } from './pipeline/stages/deleteLambda';
import { CLOUD_FORMATION_CHANGE_SET_INFO } from './pipeline/stages/deployCloudFormation/CloudFormationChangeSetInfo';
import { CLOUDFORMATION_TEMPLATE_ENTRY } from './pipeline/stages/deployCloudFormation/cloudFormationTemplateEntry.component';
import { DEPLOY_CLOUDFORMATION_STACK_STAGE } from './pipeline/stages/deployCloudFormation/deployCloudFormationStackStage';
import { AWS_EVALUATE_CLOUD_FORMATION_CHANGE_SET_EXECUTION_SERVICE } from './pipeline/stages/deployCloudFormation/evaluateCloudFormationChangeSetExecution.service';
import { AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY } from './pipeline/stages/deployLambda';
import { AMAZON_PIPELINE_STAGES_DESTROYASG_AWSDESTROYASGSTAGE } from './pipeline/stages/destroyAsg/awsDestroyAsgStage';
import { AMAZON_PIPELINE_STAGES_DISABLEASG_AWSDISABLEASGSTAGE } from './pipeline/stages/disableAsg/awsDisableAsgStage';
import { AMAZON_PIPELINE_STAGES_DISABLECLUSTER_AWSDISABLECLUSTERSTAGE } from './pipeline/stages/disableCluster/awsDisableClusterStage';
import { AMAZON_PIPELINE_STAGES_ENABLEASG_AWSENABLEASGSTAGE } from './pipeline/stages/enableAsg/awsEnableAsgStage';
import { AMAZON_PIPELINE_STAGES_FINDAMI_AWSFINDAMISTAGE } from './pipeline/stages/findAmi/awsFindAmiStage';
import { AMAZON_PIPELINE_STAGES_FINDIMAGEFROMTAGS_AWSFINDIMAGEFROMTAGSSTAGE } from './pipeline/stages/findImageFromTags/awsFindImageFromTagsStage';
import { AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE } from './pipeline/stages/invokeLambda';
import { AMAZON_PIPELINE_STAGES_MODIFYSCALINGPROCESS_MODIFYSCALINGPROCESSSTAGE } from './pipeline/stages/modifyScalingProcess/modifyScalingProcessStage';
import { AMAZON_PIPELINE_STAGES_RESIZEASG_AWSRESIZEASGSTAGE } from './pipeline/stages/resizeAsg/awsResizeAsgStage';
import { AMAZON_PIPELINE_STAGES_ROLLBACKCLUSTER_AWSROLLBACKCLUSTERSTAGE } from './pipeline/stages/rollbackCluster/awsRollbackClusterStage';
import { AMAZON_PIPELINE_STAGES_SCALEDOWNCLUSTER_AWSSCALEDOWNCLUSTERSTAGE } from './pipeline/stages/scaleDownCluster/awsScaleDownClusterStage';
import { AMAZON_PIPELINE_STAGES_SHRINKCLUSTER_AWSSHRINKCLUSTERSTAGE } from './pipeline/stages/shrinkCluster/awsShrinkClusterStage';
import { AMAZON_PIPELINE_STAGES_TAGIMAGE_AWSTAGIMAGESTAGE } from './pipeline/stages/tagImage/awsTagImageStage';
import { AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE } from './pipeline/stages/updateCodeLambda';
import { AWS_REACT_MODULE } from './reactShims/aws.react.module';
import { AMAZON_SEARCH_SEARCHRESULTFORMATTER } from './search/searchResultFormatter';
import { AWS_SECURITY_GROUP_MODULE } from './securityGroup/securityGroup.module';
Expand Down Expand Up @@ -114,6 +118,10 @@ module(AMAZON_MODULE, [
INSTANCE_SECURITY_GROUPS_COMPONENT,
INSTANCE_DNS_COMPONENT,
AMAZON_INSTANCE_INFORMATION_COMPONENT,
AMAZON_PIPELINE_STAGES_LAMBDA_DELETE,
AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY,
AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE,
AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE,
]).config(() => {
CloudProviderRegistry.registerProvider('aws', {
name: 'Amazon',
Expand Down
14 changes: 10 additions & 4 deletions packages/amazon/src/pipeline/stages/deleteLambda/index.ts
@@ -1,11 +1,17 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { module } from 'angular';

import { Registry, SETTINGS } from '@spinnaker/core';
import { lambdaDeleteStage } from './LambdaDeleteStage';

import { lambdaDeleteStage } from './LambdaDeleteStage';
export * from './LambdaDeleteStage';

if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaDeleteStage);
}
export const AMAZON_PIPELINE_STAGES_LAMBDA_DELETE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaDeleteStage';

module(AMAZON_PIPELINE_STAGES_LAMBDA_DELETE, []).config(function () {
if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaDeleteStage);
}
});
Expand Up @@ -15,7 +15,6 @@ import {
TetheredCreatable,
TextInput,
} from '@spinnaker/core';
import { NumberConcurrencyInput } from '@spinnaker/core/dist/presentation/forms/inputs/NumberConcurrencyInput';

import { BasicSettingsForm, ExecutionRoleForm, LambdaAtEdgeForm, NetworkForm, TriggerEventsForm } from './index';

Expand Down Expand Up @@ -96,7 +95,7 @@ export function AwsLambdaFunctionStageForm(props: IFormikStageConfigInjectedProp
help={
<HelpField content="The total number of current executions of your Lambda function that can be instantiated at any time." />
}
input={(props) => <NumberConcurrencyInput {...props} min={0} max={3000} />}
input={(props) => <NumberInput {...props} min={0} max={3000} />}
/>
<FormikFormField
name="memorySize"
Expand Down
13 changes: 10 additions & 3 deletions packages/amazon/src/pipeline/stages/deployLambda/index.ts
@@ -1,11 +1,18 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { module } from 'angular';

import { Registry, SETTINGS } from '@spinnaker/core';

import { lambdaDeploymentStage } from './config/LambdaDeploymentStage';

export * from './config/LambdaDeploymentStage';

if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaDeploymentStage);
}
export const AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY = 'spinnaker.amazon.pipeline.stage.Aws.LambdaDeploymentStage';

module(AMAZON_PIPELINE_STAGES_LAMBDA_DEPLOY, []).config(function () {
if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaDeploymentStage);
}
});
13 changes: 10 additions & 3 deletions packages/amazon/src/pipeline/stages/invokeLambda/index.ts
@@ -1,11 +1,18 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { module } from 'angular';

import { Registry, SETTINGS } from '@spinnaker/core';

import { lambdaInvokeStage } from './LambdaInvokeStage';

export * from './LambdaInvokeStage';

if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaInvokeStage);
}
export const AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaInvokeStage';

module(AMAZON_PIPELINE_STAGES_LAMBDA_INVOKE, []).config(function () {
if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaInvokeStage);
}
});
Expand Up @@ -19,7 +19,6 @@ import {
TextInput,
useData,
} from '@spinnaker/core';
import { NumberConcurrencyInput } from '@spinnaker/core/dist/presentation/forms/inputs/NumberConcurrencyInput';

import { TriggerEventsForm } from './TriggerEventsForm';
import { DeploymentStrategyForm } from './components';
Expand Down Expand Up @@ -123,7 +122,7 @@ export function RouteLambdaFunctionStageForm(props: IFormikStageConfigInjectedPr
values.deploymentStrategy === '$WEIGHTED' ? (
<NumberInput {...props} min={0} max={0} />
) : (
<NumberConcurrencyInput {...props} min={0} max={3000} />
<NumberInput {...props} min={0} max={3000} />
)
}
required={false}
Expand Down
13 changes: 10 additions & 3 deletions packages/amazon/src/pipeline/stages/routeLambda/index.ts
@@ -1,11 +1,18 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { module } from 'angular';

import { Registry, SETTINGS } from '@spinnaker/core';

import { lambdaRouteStage } from './LambdaRouteStage';

export * from './LambdaRouteStage';

if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaRouteStage);
}
export const AMAZON_PIPELINE_STAGES_LAMBDA_ROUTE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaTrafficRoutingStage';

module(AMAZON_PIPELINE_STAGES_LAMBDA_ROUTE, []).config(function () {
if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaRouteStage);
}
});
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

.LambdaCodeUpdateStageConfig {
}
13 changes: 10 additions & 3 deletions packages/amazon/src/pipeline/stages/updateCodeLambda/index.ts
@@ -1,11 +1,18 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import { module } from 'angular';

import { Registry, SETTINGS } from '@spinnaker/core';

import { lambdaUpdateCodeStage } from './LambdaUpdateCodeStage';

export * from './LambdaUpdateCodeStage';

if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaUpdateCodeStage);
}
export const AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE = 'spinnaker.amazon.pipeline.stage.Aws.LambdaUpdateCodeStage';

module(AMAZON_PIPELINE_STAGES_LAMBDA_UPDATE, []).config(function () {
if (SETTINGS.feature.lambdaAdditionalStages) {
Registry.pipeline.registerStage(lambdaUpdateCodeStage);
}
});

This file was deleted.

0 comments on commit 93bab65

Please sign in to comment.