Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

servicediscovery compatability issue with localstack #2556

Closed
2 tasks done
codefromthecrypt opened this issue Mar 14, 2024 · 0 comments
Closed
2 tasks done

servicediscovery compatability issue with localstack #2556

codefromthecrypt opened this issue Mar 14, 2024 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@codefromthecrypt
Copy link

Acknowledgements

Describe the bug

DiscoverInstances prefixes "data-" to the hostname, rendering localhost (specifically localstack) tests useless, as the hostname "data-localhost" doesn't exist.

Expected Behavior

I would like to use all servicediscovery functions. I'm not sure why others work and DiscoverInstances specifically does this

Current Behavior

I end up with an error like this:

2024-03-14T12:39:51.350703Z	error	unable to refresh Cloud Map cache due to error, using existing cache: error retrieving instance list from Cloud Map for "1" in "testns": operation error ServiceDiscovery: DiscoverInstances, https response error StatusCode: 0, RequestID: , request send failed, Post "http://data-localhost:32957/": dial tcp: lookup data-localhost: no such host

Reproduction Steps

localstack requires an authenticated docker image (localstack-pro) to run, so probably reproduction won't help as much, but the command that fails looks like this:

	instOutput, err := client.DiscoverInstances(ctx, &servicediscovery.DiscoverInstancesInput{ServiceName: svc.Name, NamespaceName: ns.Name})
	if err != nil {
		return nil, errors.Wrapf(err, "error retrieving instance list from Cloud Map for %q in %q", *svc.Name, *ns.Name)
	}

Possible Solution

maybe there is a way to avoid this part of the stack. I don't mind a workaround for testing.

Additional Information/Context

where the prefix happens: https://github.com/aws/aws-sdk-go-v2/blob/main/service/servicediscovery/api_op_DiscoverInstances.go#L193

AWS Go SDK V2 Module Versions Used

	github.com/aws/aws-sdk-go-v2 v1.25.3
	github.com/aws/aws-sdk-go-v2/config v1.27.7
	github.com/aws/aws-sdk-go-v2/credentials v1.17.7
	github.com/aws/aws-sdk-go-v2/service/servicediscovery v1.29.2

Compiler and Version used

go version go1.22.1 darwin/arm64

Operating System and version

macOS 14.4

@codefromthecrypt codefromthecrypt added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Mar 14, 2024
@aws aws locked and limited conversation to collaborators Mar 14, 2024
@lucix-aws lucix-aws converted this issue into discussion #2557 Mar 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant