Skip to content

Commit 3b4a95e

Browse files
authoredAug 31, 2023
fix: remove empty elements from tag list (#936)
## Description In rare cases the `amazonec2-tags` may contain empty elements which show up as `,__PARENT_TAG__` which is not a valid value for AWS API to create an instance. The problem is that `runner_tags` must be removed if it is empty. Otherwise the empty element is inserted into the final string which results in a preceding `,`. Closes #933 ## Verification Verified manually with - no tags --> `__PARENT_TAG__` - with tags --> `tag1,value1,__PARENT_TAG`
1 parent 92a93e4 commit 3b4a95e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎template/runner-config.tftpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ listen_address = "${prometheus_listen_address}"
6565
"amazonec2-request-spot-instance=${runners_request_spot_instance}",
6666
%{~ if runners_spot_price_bid != "" ~}"amazonec2-spot-price=${runners_spot_price_bid}",%{~ endif ~}
6767
"amazonec2-security-group=${runners_security_group_name}",
68-
"amazonec2-tags=${runners_tags},__PARENT_TAG__",
68+
"amazonec2-tags=${join(",", compact([runners_tags, "__PARENT_TAG__"]))}",
6969
"amazonec2-use-ebs-optimized-instance=${runners_ebs_optimized}",
7070
"amazonec2-monitoring=${runners_monitoring}",
7171
"amazonec2-iam-instance-profile=%{ if runners_iam_instance_profile_name != "" }${runners_iam_instance_profile_name}%{ else }${runners_instance_profile}%{ endif ~}",

0 commit comments

Comments
 (0)
Please sign in to comment.