Skip to content

Commit 18081f9

Browse files
committed
Include additional logs to debug error in Update Service
1 parent cc490ca commit 18081f9

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

dist/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,29 +210,28 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
210210

211211
core.debug('Updating the service contd..');
212212

213-
let volumeConfigurations = []
214-
let volumeConfigurationJSON = {}
213+
let volumeConfigurations;
215214
let serviceManagedEbsVolumeObject;
216215

217216
if (serviceManagedEbsVolumeName != '') {
218217
core.debug(`Assigning VolumeConfiguration Name: ${serviceManagedEbsVolumeName}`);
219218
core.debug('Assigning VolumeConfiguration.');
220219
if (serviceManagedEbsVolume != '{}') {
221220
serviceManagedEbsVolumeObject = convertToManagedEbsVolumeObject(serviceManagedEbsVolume);
222-
volumeConfigurationJSON["name"] = serviceManagedEbsVolumeName;
223-
volumeConfigurationJSON["managedEBSVolume"] = serviceManagedEbsVolumeObject;
224-
volumeConfigurations.push(volumeConfigurationJSON);
221+
volumeConfigurations = [{
222+
name: serviceManagedEbsVolumeName,
223+
managedEBSVolume: serviceManagedEbsVolumeObject // Note the exact casing here
224+
}];
225225
core.debug('Assigning VolumeConfiguration Object');
226226
} else {
227227
core.warning('service-managed-ebs-volume-name provided without service-managed-ebs-volume value. Ignoring service-managed-ebs-volume property');
228228
}
229229
} else {
230230
core.debug('No VolumeConfiguration Property provided for service-managed-ebs-volume');
231231
}
232-
core.debug('VolumeConfiguration Value: ${volumeConfiguration}');
232+
core.debug(`VolumeConfiguration Value: ${volumeConfigurations}`);
233233
core.debug('VolumeConfiguration Value Set.');
234234

235-
236235
let params = {
237236
cluster: clusterName,
238237
service: service,
@@ -243,6 +242,10 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
243242
volumeConfigurations: volumeConfigurations
244243
};
245244

245+
core.debug(`Volume Configurations: ${JSON.stringify(volumeConfigurations, null, 2)}`);
246+
core.debug(`Managed EBS Volume Object: ${JSON.stringify(serviceManagedEbsVolumeObject, null, 2)}`);
247+
core.debug(`Final params: ${JSON.stringify(params, null, 2)}`);
248+
246249
// Add the desiredCount property only if it is defined and a number.
247250
if (!isNaN(desiredCount) && desiredCount !== undefined) {
248251
params.desiredCount = desiredCount;

index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,29 +204,28 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
204204

205205
core.debug('Updating the service contd..');
206206

207-
let volumeConfigurations = []
208-
let volumeConfigurationJSON = {}
207+
let volumeConfigurations;
209208
let serviceManagedEbsVolumeObject;
210209

211210
if (serviceManagedEbsVolumeName != '') {
212211
core.debug(`Assigning VolumeConfiguration Name: ${serviceManagedEbsVolumeName}`);
213212
core.debug('Assigning VolumeConfiguration.');
214213
if (serviceManagedEbsVolume != '{}') {
215214
serviceManagedEbsVolumeObject = convertToManagedEbsVolumeObject(serviceManagedEbsVolume);
216-
volumeConfigurationJSON["name"] = serviceManagedEbsVolumeName;
217-
volumeConfigurationJSON["managedEBSVolume"] = serviceManagedEbsVolumeObject;
218-
volumeConfigurations.push(volumeConfigurationJSON);
215+
volumeConfigurations = [{
216+
name: serviceManagedEbsVolumeName,
217+
managedEBSVolume: serviceManagedEbsVolumeObject // Note the exact casing here
218+
}];
219219
core.debug('Assigning VolumeConfiguration Object');
220220
} else {
221221
core.warning('service-managed-ebs-volume-name provided without service-managed-ebs-volume value. Ignoring service-managed-ebs-volume property');
222222
}
223223
} else {
224224
core.debug('No VolumeConfiguration Property provided for service-managed-ebs-volume');
225225
}
226-
core.debug('VolumeConfiguration Value: ${volumeConfiguration}');
226+
core.debug(`VolumeConfiguration Value: ${volumeConfigurations}`);
227227
core.debug('VolumeConfiguration Value Set.');
228228

229-
230229
let params = {
231230
cluster: clusterName,
232231
service: service,
@@ -237,6 +236,10 @@ async function updateEcsService(ecs, clusterName, service, taskDefArn, waitForSe
237236
volumeConfigurations: volumeConfigurations
238237
};
239238

239+
core.debug(`Volume Configurations: ${JSON.stringify(volumeConfigurations, null, 2)}`);
240+
core.debug(`Managed EBS Volume Object: ${JSON.stringify(serviceManagedEbsVolumeObject, null, 2)}`);
241+
core.debug(`Final params: ${JSON.stringify(params, null, 2)}`);
242+
240243
// Add the desiredCount property only if it is defined and a number.
241244
if (!isNaN(desiredCount) && desiredCount !== undefined) {
242245
params.desiredCount = desiredCount;

0 commit comments

Comments
 (0)