-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Use workspaceStatus stream rpc in supervisor #15403
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
Conversation
started the job as gitpod-build-hw-pub-stream.3 because the annotations in the pull request description changed |
f6fd8d7
to
4ba5e33
Compare
b5953ca
to
ae0c017
Compare
/hold |
if port.Policy == v1.PortPolicy_PORT_POLICY_PUBLIC { | ||
info.Visibility = gitpod.PortVisibilityPublic | ||
} else { | ||
info.Visibility = gitpod.PortVisibilityPrivate | ||
} |
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.
PortPolicy is one of 3 values:
PortPolicy_PORT_POLICY_UNSPECIFIED PortPolicy = 0
// Private means the port is accessible by the workspace owner only using the workspace port URL
PortPolicy_PORT_POLICY_PRIVATE PortPolicy = 1
// Public means the port is accessible by everybody using the workspace port URL
PortPolicy_PORT_POLICY_PUBLIC PortPolicy = 2
Use a switch here and handle them all. This ensures that you actually detect cases where the port policy is not set (UNSPECIFIED)
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.
It's the same as here, it can only be public or private and if for some reason is unspecified it should convert to private either way 🤔
gitpod/components/supervisor/pkg/serverapi/publicapi.go
Lines 406 to 410 in 6245c32
if port.Policy == v1.PortPolicy_PORT_POLICY_PUBLIC { | |
info.Visibility = gitpod.PortVisibilityPublic | |
} else { | |
info.Visibility = gitpod.PortVisibilityPrivate | |
} |
4f512f0
to
6245c32
Compare
2ee4c99
to
c4900d8
Compare
f98130f
to
829f1ea
Compare
Co-authored-by: mustard <[email protected]> Co-authored-by: Jean Pierre <[email protected]>
829f1ea
to
77ed9d5
Compare
Test with
|
/unhold |
/werft run 👍 started the job as gitpod-build-hw-pub-stream.19 |
Description
Use workspaceStatus stream rpc in supervisor
Requires #15451
Related #15383
How to test
Open a workspace and check port view updates successfully when changing port state to public/private
Release Notes
Documentation
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh