Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading Spinnaker from 1.33.2 to 1.33.3 #9

Merged
merged 7 commits into from
Jul 5, 2024
10 changes: 10 additions & 0 deletions packages/amazon/src/aws.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,27 @@ 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_LAMBDA_ROUTE } from './pipeline/stages/routeLambda';
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 +119,11 @@ 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,
AMAZON_PIPELINE_STAGES_LAMBDA_ROUTE,
]).config(() => {
CloudProviderRegistry.registerProvider('aws', {
name: 'Amazon',
Expand Down
14 changes: 10 additions & 4 deletions packages/amazon/src/pipeline/stages/deleteLambda/index.ts
Original file line number Diff line number Diff line change
@@ -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);
}
});
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function InvokeLambdaOperation(props: IFormikStageConfigInjectedProps) {
ArtifactTypePatterns.BITBUCKET_FILE,
ArtifactTypePatterns.CUSTOM_OBJECT,
ArtifactTypePatterns.EMBEDDED_BASE64,
ArtifactTypePatterns.REMOTE_BASE64,
ArtifactTypePatterns.GCS_OBJECT,
ArtifactTypePatterns.GITHUB_FILE,
ArtifactTypePatterns.GITLAB_FILE,
Expand Down
13 changes: 10 additions & 3 deletions packages/amazon/src/pipeline/stages/invokeLambda/index.ts
Original file line number Diff line number Diff line change
@@ -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);
}
});
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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);
}
});
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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);
}
});
1 change: 1 addition & 0 deletions packages/core/src/config/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export interface ISpinnakerSettings {
};
stashTriggerInfo?: string;
pollSchedule: number;
tasksViewLimitPerPage: number;
providers?: {
[key: string]: IProviderSettings; // allows custom providers not typed in here (good for testing too)
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,72 +8,101 @@ export interface IRedBlackStrategyAdditionalFieldsProps extends IDeploymentStrat
command: IRedBlackCommand;
}

export const AdditionalFields = ({ command, onChange }: IRedBlackStrategyAdditionalFieldsProps) => (
<div className="form-group">
<div className="col-md-12 checkbox">
<label>
<input
type="checkbox"
checked={command.rollback?.onFailure ?? false}
onChange={(e) => onChange('rollback.onFailure', e.target.checked)}
/>
Rollback to previous server group if deployment fails <HelpField id="strategy.redblack.rollback" />
</label>
</div>
<div className="col-md-12 checkbox">
<label>
<input type="checkbox" checked={command.scaleDown} onChange={(e) => onChange('scaleDown', e.target.checked)} />
Scale down replaced server groups to zero instances
<HelpField id="strategy.redblack.scaleDown" />
</label>
</div>
<div className="col-md-12 form-inline">
<label>
Maximum number of server groups to leave
<HelpField id="strategy.redblack.maxRemainingAsgs" />
</label>
<input
className="form-control input-sm"
style={{ width: '50px' }}
type="number"
value={command.maxRemainingAsgs}
onChange={(e) => onChange('maxRemainingAsgs', e.target.value)}
min="2"
/>
</div>
<div className="col-md-12 form-inline">
<label>
Wait Before Disable
<HelpField content="Time to wait before disabling all old server groups in this cluster" />
</label>
<input
className="form-control input-sm"
style={{ width: '60px' }}
min="0"
type="number"
value={command.delayBeforeDisableSec}
onChange={(e) => onChange('delayBeforeDisableSec', e.target.value)}
placeholder="0"
/>
seconds
</div>
{command.scaleDown && (
<div className="col-md-12 form-inline" style={{ marginTop: '5px' }}>
<label>
Wait Before Scale Down
<HelpField content="Time to wait before scaling down all old server groups in this cluster" />
</label>
<input
className="form-control input-sm"
style={{ width: '60px' }}
min="0"
type="number"
value={command.delayBeforeScaleDownSec}
onChange={(e) => onChange('delayBeforeScaleDownSec', e.target.value)}
placeholder="0"
/>
seconds
export class AdditionalFields extends React.Component<IRedBlackStrategyAdditionalFieldsProps> {
private rollbackOnFailureChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.rollback.onFailure = e.target.checked;
this.forceUpdate();
};

private scaleDownChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.scaleDown = e.target.checked;
this.forceUpdate();
};

private maxRemainingAsgsChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.maxRemainingAsgs = parseInt(e.target.value, 10);
this.forceUpdate();
};

private delayBeforeDisableSecChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.delayBeforeDisableSec = parseInt(e.target.value, 10);
this.forceUpdate();
};

private delayBeforeScaleDownSecChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.props.command.delayBeforeScaleDownSec = parseInt(e.target.value, 10);
this.forceUpdate();
};

public render() {
const { command } = this.props;
return (
<div className="form-group">
<div className="col-md-12 checkbox" style={{ marginTop: 0 }}>
<label>
<input
type="checkbox"
checked={command.rollback?.onFailure ?? false}
onChange={this.rollbackOnFailureChange}
/>
Rollback to previous server group if deployment fails <HelpField id="strategy.redblack.rollback" />
</label>
</div>
<div className="col-md-12 checkbox">
<label>
<input type="checkbox" checked={command.scaleDown} onChange={this.scaleDownChange} />
Scale down replaced server groups to zero instances <HelpField id="strategy.redblack.scaleDown" />
</label>
</div>
<div className="col-md-12 form-inline">
<label>
Maximum number of server groups to leave
<HelpField id="strategy.redblack.maxRemainingAsgs" />
</label>
<input
className="form-control input-sm"
style={{ width: '50px' }}
type="number"
value={command.maxRemainingAsgs}
onChange={this.maxRemainingAsgsChange}
min="2"
/>
</div>
<div className="col-md-12 form-inline">
<label>
Wait Before Disable
<HelpField content="Time to wait before disabling all old server groups in this cluster" />
</label>
<input
className="form-control input-sm"
style={{ width: '60px' }}
min="0"
type="number"
value={command.delayBeforeDisableSec}
onChange={this.delayBeforeDisableSecChange}
placeholder="0"
/>
seconds
</div>
{command.scaleDown && (
<div className="col-md-12 form-inline" style={{ marginTop: '5px' }}>
<label>
Wait Before Scale Down
<HelpField content="Time to wait before scaling down all old server groups in this cluster" />
</label>
<input
className="form-control input-sm"
style={{ width: '60px' }}
min="0"
type="number"
value={command.delayBeforeScaleDownSec}
onChange={this.delayBeforeScaleDownSecChange}
placeholder="0"
/>
seconds
</div>
)}
</div>
)}
</div>
);
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export class PipelineConfigService {
private static groupStagesByRequisiteStageRefIds(pipeline: IPipeline) {
return pipeline.stages.reduce((acc, obj) => {
const parent = obj['refId'];
if (obj['requisiteStageRefIds'] === undefined) {
obj['requisiteStageRefIds'] = [];
}
obj.requisiteStageRefIds.forEach((child) => {
const values = acc.get(child);
if (values && values.length) {
Expand Down
Loading
Loading