Skip to content

Conversation

mikeland73
Copy link
Contributor

Summary

This improves:

  • port auto-forwarding only happens on CLI shells
  • Print port on service proxy if available.
  • Refactor common cloud env variables into a single package

How was it tested?

builds

@mikeland73 mikeland73 requested review from gcurtis and savil March 17, 2023 18:24
Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for envir !

Comment on lines +169 to +189
for _, service := range services {
if port, _ := service.Port(); port != "" {
color.New(color.FgHiGreen).Fprintf(
w,
"To access %s on this vm use: %s-%s.svc.devbox.sh\n",
service.Name,
hostname,
port,
)
} else {
printGeneric = true
}
}

if printGeneric {
color.New(color.FgHiGreen).Fprintf(
w,
"To access other services on this vm use: %s-<port>.svc.devbox.sh\n",
hostname,
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if I have 3 services, but only one has a port, then this will print for just the one having-port-service. That seems problematic because users will worry about how to access the other-non-explicity-port-services.

Could we improve this to:

To access <having-port-service> on this vm use: ....
To access other services on this vm use: .....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current behavior is what you are describing. If at least one service doesn't have a declared port, printGeneric will be true so we print the last message.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh you are right. booleans are hard!

@mikeland73 mikeland73 merged commit 7bb8d1e into main Mar 20, 2023
@mikeland73 mikeland73 deleted the landau/service-improvements branch March 20, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants