Skip to content

[public-api] Do not use localhost as address, not reachable in containers/k8s #10099

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

Merged
merged 1 commit into from
May 18, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented May 18, 2022

Description

Address can't be localhost, as it can't be reached when in a container. The change ensures that the server listens on any address, not just localhost.

Related Issue(s)

Fixes #

How to test

cd dev/gpctl
➜ go run main.go api workspaces get --id 123 --token foo --address api.mp-public-68262df4fb.preview.gitpod-dev.com:443
INFO[0000] Establishing gRPC connection against api.mp-public-68262df4fb.preview.gitpod-dev.com:443
FATA[0032] Failed to retrieve workspace.                 error="failed to retrieve workspace (ID: 123): rpc error: code = PermissionDenied desc = insufficient permission to access workspace"
exit status 1

The above shows that the service is in fact reachable.

Release Notes

NONE

Documentation

NONE

@easyCZ easyCZ force-pushed the mp/public-api-fix-connectivity branch from 70e4937 to c265f8c Compare May 18, 2022 12:22
@easyCZ easyCZ marked this pull request as ready for review May 18, 2022 12:29
@easyCZ easyCZ requested a review from a team May 18, 2022 12:29
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label May 18, 2022
@easyCZ
Copy link
Member Author

easyCZ commented May 18, 2022

/werft run

👍 started the job as gitpod-build-mp-public-api-fix-connectivity.2
(with .werft/ from main)

@easyCZ easyCZ force-pushed the mp/public-api-fix-connectivity branch from c265f8c to ff80edf Compare May 18, 2022 12:57
@easyCZ easyCZ requested a review from a team May 18, 2022 12:57
@github-actions github-actions bot added the team: workspace Issue belongs to the Workspace team label May 18, 2022
@easyCZ easyCZ changed the title [public-api] Do not use localhost as address, not reachable in k8s [public-api] Do not use localhost as address, not reachable in containers/k8s May 18, 2022
@roboquat roboquat merged commit 49e3d1e into main May 18, 2022
@roboquat roboquat deleted the mp/public-api-fix-connectivity branch May 18, 2022 13:20
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants