Skip to content

Commit 621c84c

Browse files
committed
Revert action.yml
Resolve conflict on autogenerated dist/index.js Revert src/index.js Generate src/index.js revert src/index.js Generate src/index.js
1 parent 94093ce commit 621c84c

File tree

1 file changed

+8
-84
lines changed

1 file changed

+8
-84
lines changed

dist/index.js

Lines changed: 8 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
3939
const assignPublicIP = core.getInput('run-task-assign-public-IP', { required: false }) || 'DISABLED';
4040
const tags = JSON.parse(core.getInput('run-task-tags', { required: false }) || '[]');
4141
const capacityProviderStrategy = JSON.parse(core.getInput('run-task-capacity-provider-strategy', { required: false }) || '[]');
42-
const runTaskManagedEBSVolumeName = core.getInput('run-task-managed-ebs-volume-name', { required: false }) || '';
43-
const runTaskManagedEBSVolume = core.getInput('run-task-managed-ebs-volume', { required: false }) || '{}';
4442

4543
let awsvpcConfiguration = {}
4644

@@ -55,20 +53,6 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
5553
if(assignPublicIP != "" && (subnetIds != "" || securityGroupIds != "")){
5654
awsvpcConfiguration["assignPublicIp"] = assignPublicIP
5755
}
58-
let volumeConfigurations = [];
59-
let taskManagedEBSVolumeObject;
60-
61-
if (runTaskManagedEBSVolumeName != '') {
62-
if (runTaskManagedEBSVolume != '{}') {
63-
taskManagedEBSVolumeObject = convertToManagedEbsVolumeObject(runTaskManagedEBSVolume);
64-
volumeConfigurations = [{
65-
name: runTaskManagedEBSVolumeName,
66-
managedEBSVolume: taskManagedEBSVolumeObject
67-
}];
68-
} else {
69-
core.warning(`run-task-managed-ebs-volume-name provided without run-task-managed-ebs-volume value. VolumeConfigurations property will not be included in the RunTask API call`);
70-
}
71-
}
7256

7357
const runTaskResponse = await ecs.runTask({
7458
startedBy: startedBy,
@@ -81,8 +65,7 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
8165
launchType: capacityProviderStrategy.length === 0 ? launchType : null,
8266
networkConfiguration: Object.keys(awsvpcConfiguration).length === 0 ? null : { awsvpcConfiguration: awsvpcConfiguration },
8367
enableECSManagedTags: enableECSManagedTags,
84-
tags: tags,
85-
volumeConfigurations: volumeConfigurations
68+
tags: tags
8669
});
8770

8871
core.debug(`Run task response ${JSON.stringify(runTaskResponse)}`)
@@ -109,47 +92,6 @@ async function runTask(ecs, clusterName, taskDefArn, waitForMinutes, enableECSMa
10992
}
11093
}
11194

112-
function convertToManagedEbsVolumeObject(managedEbsVolume) {
113-
managedEbsVolumeObject = {}
114-
const ebsVolumeObject = JSON.parse(managedEbsVolume);
115-
if ('roleArn' in ebsVolumeObject){ // required property
116-
managedEbsVolumeObject.roleArn = ebsVolumeObject.roleArn;
117-
core.debug(`Found RoleArn ${ebsVolumeObject['roleArn']}`);
118-
} else {
119-
throw new Error('managed-ebs-volume must provide "role-arn" to associate with the EBS volume')
120-
}
121-
122-
if ('encrypted' in ebsVolumeObject) {
123-
managedEbsVolumeObject.encrypted = ebsVolumeObject.encrypted;
124-
}
125-
if ('filesystemType' in ebsVolumeObject) {
126-
managedEbsVolumeObject.filesystemType = ebsVolumeObject.filesystemType;
127-
}
128-
if ('iops' in ebsVolumeObject) {
129-
managedEbsVolumeObject.iops = ebsVolumeObject.iops;
130-
}
131-
if ('kmsKeyId' in ebsVolumeObject) {
132-
managedEbsVolumeObject.kmsKeyId = ebsVolumeObject.kmsKeyId;
133-
}
134-
if ('sizeInGiB' in ebsVolumeObject) {
135-
managedEbsVolumeObject.sizeInGiB = ebsVolumeObject.sizeInGiB;
136-
}
137-
if ('snapshotId' in ebsVolumeObject) {
138-
managedEbsVolumeObject.snapshotId = ebsVolumeObject.snapshotId;
139-
}
140-
if ('tagSpecifications' in ebsVolumeObject) {
141-
managedEbsVolumeObject.tagSpecifications = ebsVolumeObject.tagSpecifications;
142-
}
143-
if (('throughput' in ebsVolumeObject) && (('volumeType' in ebsVolumeObject) && (ebsVolumeObject.volumeType == 'gp3'))){
144-
managedEbsVolumeObject.throughput = ebsVolumeObject.throughput;
145-
}
146-
if ('volumeType' in ebsVolumeObject) {
147-
managedEbsVolumeObject.volumeType = ebsVolumeObject.volumeType;
148-
}
149-
core.debug(`Created managedEbsVolumeObject: ${JSON.stringify(managedEbsVolumeObject)}`);
150-
return managedEbsVolumeObject;
151-
}
152-
15395
// Poll tasks until they enter a stopped state
15496
async function waitForTasksStopped(ecs, clusterName, taskArns, waitForMinutes) {
15597
if (waitForMinutes > MAX_WAIT_MINUTES) {
@@ -200,32 +142,13 @@ async function tasksExitCode(ecs, clusterName, taskArns) {
200142
async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForService, waitForMinutes, forceNewDeployment, desiredCount, enableECSManagedTags, propagateTags) {
201143
core.debug('Updating the service');
202144

203-
const serviceManagedEBSVolumeName = core.getInput('service-managed-ebs-volume-name', { required: false }) || '';
204-
const serviceManagedEBSVolume = core.getInput('service-managed-ebs-volume', { required: false }) || '{}';
205-
206-
let volumeConfigurations = [];
207-
let serviceManagedEbsVolumeObject;
208-
209-
if (serviceManagedEBSVolumeName != '') {
210-
if (serviceManagedEBSVolume != '{}') {
211-
serviceManagedEbsVolumeObject = convertToManagedEbsVolumeObject(serviceManagedEBSVolume);
212-
volumeConfigurations = [{
213-
name: serviceManagedEBSVolumeName,
214-
managedEBSVolume: serviceManagedEbsVolumeObject
215-
}];
216-
} else {
217-
core.warning('service-managed-ebs-volume-name provided without service-managed-ebs-volume value. VolumeConfigurations property will not be included in the UpdateService API call');
218-
}
219-
}
220-
221145
let params = {
222146
cluster: clusterName,
223147
service: service,
224148
taskDefinition: taskDefArn,
225149
forceNewDeployment: forceNewDeployment,
226150
enableECSManagedTags: enableECSManagedTags,
227-
propagateTags: propagateTags,
228-
volumeConfigurations: volumeConfigurations
151+
propagateTags: propagateTags
229152
};
230153

231154
// Add the desiredCount property only if it is defined and a number.
@@ -486,11 +409,7 @@ async function run() {
486409
if (enableECSManagedTagsInput !== '') {
487410
enableECSManagedTags = enableECSManagedTagsInput.toLowerCase() === 'true';
488411
}
489-
const propagateTagsInput = core.getInput('propagate-tags', { required: false }) || '';
490-
let propagateTags = null;
491-
if (propagateTagsInput !== '') {
492-
propagateTags = propagateTagsInput;
493-
}
412+
let propagateTags = core.getInput('propagate-tags', { required: false }) || '';
494413

495414
// Register the task definition
496415
core.debug('Registering the task definition');
@@ -538,6 +457,11 @@ async function run() {
538457
if (serviceResponse.status != 'ACTIVE') {
539458
throw new Error(`Service is ${serviceResponse.status}`);
540459
}
460+
// set propagateTags to the current value if no input provided
461+
if (describeResponse.services[0].propagateTags != null && propagateTags === '') {
462+
propagateTags = describeResponse.services[0].propagateTags;
463+
core.debug(`Current service 'propagateTags' value '${describeResponse.services[0].propagateTags}' will be set to service`);
464+
}
541465

542466
if (!serviceResponse.deploymentController || !serviceResponse.deploymentController.type || serviceResponse.deploymentController.type === 'ECS') {
543467
// Service uses the 'ECS' deployment controller, so we can call UpdateService

0 commit comments

Comments
 (0)