Skip to content
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

🩹 pd: fix auto-https default grpc address #3650

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

cratelyn
Copy link
Contributor

@cratelyn cratelyn commented Jan 23, 2024

while working on #3627, i found that a conditional hinges on the wrong option.

this changes pd to follow what the comments and documentation state as the
intent of this code: change the default grpc address based on whether we
have an auto-managed https domain.

a second commit refactors the control flow for the default address. the parse
calls only refer to hardcoded values defined in the source. let's define our
defaults as constants, so that we do not have error-handling logic that only
refers to what ought to be known-good addresses.

this conditional hinges on the wrong option.

currently, we have this table of outcomes:

```
           grpc_bind|Some(grpc) |None        |
auto-https          |-----------|------------|
on                  |grpc       |0.0.0.0:8080|
off                 |grpc       |0.0.0.0:8080|
```

change this to follow what the comments and documentation state as the
intent of this code: change the default grpc address based on whether we
have an auto-managed https domain.
the `parse` calls below only refer to hardcoded values defined in the
source. let's define our defaults as constants, so that we do not have
error-handling logic that only refers to what ought to be known-good
addresses.
@cratelyn cratelyn added the C-bug Category: a bug label Jan 23, 2024
@cratelyn cratelyn self-assigned this Jan 23, 2024
let grpc_bind = if grpc_bind.is_some() {
let grpc_bind = if grpc_auto_https.is_some() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactors are done in a separate commit to highlight ☝️ this is as the core mechanical issue at hand.

@cratelyn cratelyn marked this pull request as ready for review January 23, 2024 00:36
@hdevalence hdevalence merged commit 2cdd27b into main Jan 23, 2024
7 checks passed
@hdevalence hdevalence deleted the katie/fix-auto-https-default-grpc-endpoint branch January 23, 2024 02:38
@conorsch
Copy link
Contributor

Nice, thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: a bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants