-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to fix cluster, container, and taks ARNs in AWS ECS detector when…
… some of them are not valid
- Loading branch information
Showing
5 changed files
with
282 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
detectors/aws/ecs/test/metadatav4-response-container-ec2-bad-container-arn.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"DockerId": "ea32192c8553fbff06c9340478a2ff089b2bb5646fb718b4ee206641c9086d66", | ||
"Name": "curl", | ||
"DockerName": "ecs-curltest-24-curl-cca48e8dcadd97805600", | ||
"Image": "111122223333.dkr.ecr.us-west-2.amazonaws.com/curltest:latest", | ||
"ImageID": "sha256:d691691e9652791a60114e67b365688d20d19940dde7c4736ea30e660d8d3553", | ||
"Labels": { | ||
"com.amazonaws.ecs.cluster": "default", | ||
"com.amazonaws.ecs.container-name": "curl", | ||
"com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-west-2:111122223333:task/default/8f03e41243824aea923aca126495f665", | ||
"com.amazonaws.ecs.task-definition-family": "curltest", | ||
"com.amazonaws.ecs.task-definition-version": "24" | ||
}, | ||
"DesiredStatus": "RUNNING", | ||
"KnownStatus": "RUNNING", | ||
"Limits": { | ||
"CPU": 10, | ||
"Memory": 128 | ||
}, | ||
"CreatedAt": "2020-10-02T00:15:07.620912337Z", | ||
"StartedAt": "2020-10-02T00:15:08.062559351Z", | ||
"Type": "NORMAL", | ||
"LogDriver": "awslogs", | ||
"LogOptions": { | ||
"awslogs-create-group": "true", | ||
"awslogs-group": "/ecs/metadata", | ||
"awslogs-region": "us-west-2", | ||
"awslogs-stream": "ecs/curl/8f03e41243824aea923aca126495f665" | ||
}, | ||
"ContainerARN": "0206b271-b33f-47ab-86c6-a0ba208a70a9", | ||
"Networks": [ | ||
{ | ||
"NetworkMode": "awsvpc", | ||
"IPv4Addresses": [ | ||
"10.0.2.100" | ||
], | ||
"AttachmentIndex": 0, | ||
"MACAddress": "0e:9e:32:c7:48:85", | ||
"IPv4SubnetCIDRBlock": "10.0.2.0/24", | ||
"PrivateDNSName": "ip-10-0-2-100.us-west-2.compute.internal", | ||
"SubnetGatewayIpv4Address": "10.0.2.1/24" | ||
} | ||
] | ||
} |
94 changes: 94 additions & 0 deletions
94
detectors/aws/ecs/test/metadatav4-response-task-ec2-bad-task-arn.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"Cluster": "default", | ||
"TaskARN": "default/158d1c8083dd49d6b527399fd6414f5c", | ||
"Family": "curltest", | ||
"Revision": "26", | ||
"DesiredStatus": "RUNNING", | ||
"KnownStatus": "RUNNING", | ||
"PullStartedAt": "2020-10-02T00:43:06.202617438Z", | ||
"PullStoppedAt": "2020-10-02T00:43:06.31288465Z", | ||
"AvailabilityZone": "us-west-2d", | ||
"LaunchType": "EC2", | ||
"Containers": [ | ||
{ | ||
"DockerId": "598cba581fe3f939459eaba1e071d5c93bb2c49b7d1ba7db6bb19deeb70d8e38", | ||
"Name": "~internal~ecs~pause", | ||
"DockerName": "ecs-curltest-26-internalecspause-e292d586b6f9dade4a00", | ||
"Image": "amazon/amazon-ecs-pause:0.1.0", | ||
"ImageID": "", | ||
"Labels": { | ||
"com.amazonaws.ecs.cluster": "default", | ||
"com.amazonaws.ecs.container-name": "~internal~ecs~pause", | ||
"com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-west-2:111122223333:task/default/158d1c8083dd49d6b527399fd6414f5c", | ||
"com.amazonaws.ecs.task-definition-family": "curltest", | ||
"com.amazonaws.ecs.task-definition-version": "26" | ||
}, | ||
"DesiredStatus": "RESOURCES_PROVISIONED", | ||
"KnownStatus": "RESOURCES_PROVISIONED", | ||
"Limits": { | ||
"CPU": 0, | ||
"Memory": 0 | ||
}, | ||
"CreatedAt": "2020-10-02T00:43:05.602352471Z", | ||
"StartedAt": "2020-10-02T00:43:06.076707576Z", | ||
"Type": "CNI_PAUSE", | ||
"Networks": [ | ||
{ | ||
"NetworkMode": "awsvpc", | ||
"IPv4Addresses": [ | ||
"10.0.2.61" | ||
], | ||
"AttachmentIndex": 0, | ||
"MACAddress": "0e:10:e2:01:bd:91", | ||
"IPv4SubnetCIDRBlock": "10.0.2.0/24", | ||
"PrivateDNSName": "ip-10-0-2-61.us-west-2.compute.internal", | ||
"SubnetGatewayIpv4Address": "10.0.2.1/24" | ||
} | ||
] | ||
}, | ||
{ | ||
"DockerId": "ee08638adaaf009d78c248913f629e38299471d45fe7dc944d1039077e3424ca", | ||
"Name": "curl", | ||
"DockerName": "ecs-curltest-26-curl-a0e7dba5aca6d8cb2e00", | ||
"Image": "111122223333.dkr.ecr.us-west-2.amazonaws.com/curltest:latest", | ||
"ImageID": "sha256:d691691e9652791a60114e67b365688d20d19940dde7c4736ea30e660d8d3553", | ||
"Labels": { | ||
"com.amazonaws.ecs.cluster": "default", | ||
"com.amazonaws.ecs.container-name": "curl", | ||
"com.amazonaws.ecs.task-arn": "arn:aws:ecs:us-west-2:111122223333:task/default/158d1c8083dd49d6b527399fd6414f5c", | ||
"com.amazonaws.ecs.task-definition-family": "curltest", | ||
"com.amazonaws.ecs.task-definition-version": "26" | ||
}, | ||
"DesiredStatus": "RUNNING", | ||
"KnownStatus": "RUNNING", | ||
"Limits": { | ||
"CPU": 10, | ||
"Memory": 128 | ||
}, | ||
"CreatedAt": "2020-10-02T00:43:06.326590752Z", | ||
"StartedAt": "2020-10-02T00:43:06.767535449Z", | ||
"Type": "NORMAL", | ||
"LogDriver": "awslogs", | ||
"LogOptions": { | ||
"awslogs-create-group": "true", | ||
"awslogs-group": "/ecs/metadata", | ||
"awslogs-region": "us-west-2", | ||
"awslogs-stream": "ecs/curl/158d1c8083dd49d6b527399fd6414f5c" | ||
}, | ||
"ContainerARN": "arn:aws:ecs:us-west-2:111122223333:container/abb51bdd-11b4-467f-8f6c-adcfe1fe059d", | ||
"Networks": [ | ||
{ | ||
"NetworkMode": "awsvpc", | ||
"IPv4Addresses": [ | ||
"10.0.2.61" | ||
], | ||
"AttachmentIndex": 0, | ||
"MACAddress": "0e:10:e2:01:bd:91", | ||
"IPv4SubnetCIDRBlock": "10.0.2.0/24", | ||
"PrivateDNSName": "ip-10-0-2-61.us-west-2.compute.internal", | ||
"SubnetGatewayIpv4Address": "10.0.2.1/24" | ||
} | ||
] | ||
} | ||
] | ||
} |