-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add --proxy
flag to run local
, do host discovery for service connect services
#5412
Conversation
🍕 Here are the new binary sizes!
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## mainline #5412 +/- ##
============================================
+ Coverage 69.88% 69.89% +0.01%
============================================
Files 299 299
Lines 45374 45465 +91
Branches 295 295
============================================
+ Hits 31708 31780 +72
- Misses 12122 12140 +18
- Partials 1544 1545 +1
☔ View full report in Codecov by Sentry. |
--proxy
flag to run local
, do host discovery to service connect services--proxy
flag to run local
, do host discovery for service connect services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no complaint!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the changes to the runLocalOpts
it makes more sense to just create the orchestrator once!
if aws.StringValue(service.ServiceName) == serviceName { | ||
svc := Service(*service) | ||
return &svc, nil | ||
if aws.StringValue(svcs[0].ServiceName) != serviceName { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check the length just in case 🥺
host: aws.StringValue(alias.DnsName), | ||
port: strconv.Itoa(int(aws.Int64Value(alias.Port))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is: this might be too Copilot specific assuming we always set sc service through ClientAliases
. We can refactor later but we probably should add a comment for what assumption we make for now 🤔
for _, svc := range svcs { | ||
// find the primary deployment with service connect enabled | ||
idx := slices.IndexFunc(svc.Deployments, func(dep *sdkecs.Deployment) bool { | ||
return aws.StringValue(dep.Status) == "PRIMARY" && aws.BoolValue(dep.ServiceConnectConfiguration.Enabled) | ||
}) | ||
if idx == -1 { | ||
continue | ||
} | ||
|
||
for _, sc := range svc.Deployments[idx].ServiceConnectConfiguration.Services { | ||
for _, alias := range sc.ClientAliases { | ||
hosts = append(hosts, host{ | ||
host: aws.StringValue(alias.DnsName), | ||
port: strconv.Itoa(int(aws.Int64Value(alias.Port))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can we just move the logic into the ecs
pkg? It seems to be less useful to return []awsecs.Service
than the hosts.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.