Skip to content

Commit 3846b16

Browse files
authored
Merge pull request #66 from acidlemon/fix/lanunch-type-nil
Fix: panic when config.ecs.launch_type is nil
2 parents a036a9b + b2530c9 commit 3846b16

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ecs.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,15 @@ func (e *ECS) launchTask(ctx context.Context, subdomain string, taskdef string,
217217
Cluster: aws.String(cfg.ECS.Cluster),
218218
TaskDefinition: aws.String(taskdef),
219219
NetworkConfiguration: cfg.ECS.networkConfiguration,
220-
LaunchType: types.LaunchType(*cfg.ECS.LaunchType),
221220
Overrides: ov,
222221
Count: aws.Int32(1),
223222
Tags: tags,
224223
EnableExecuteCommand: aws.ToBool(cfg.ECS.EnableExecuteCommand),
225224
}
225+
if lt := cfg.ECS.LaunchType; lt != nil {
226+
runtaskInput.LaunchType = types.LaunchType(*lt)
227+
}
228+
226229
slog.Debug(f("RunTaskInput: %v", runtaskInput))
227230
out, err := e.svc.RunTask(ctx, runtaskInput)
228231
if err != nil {

0 commit comments

Comments
 (0)