Skip to content

kube: prevent init failure when proxy listener addr host is unspecified#51839

Merged
tigrato merged 2 commits intomasterfrom
tigrato/fix-host-parse-kube-api
Feb 4, 2025
Merged

kube: prevent init failure when proxy listener addr host is unspecified#51839
tigrato merged 2 commits intomasterfrom
tigrato/fix-host-parse-kube-api

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Feb 4, 2025

This PR fixes an issue caused by configuring Teleport proxy listener address without a host :443 or in ipv6 form [::]:443.

The call to utils.SplitHostPort was checking if the host was empty after the split which caused proxies to fail to initialize.

:443 is equivalent to 0.0.0.0:443.

Fixes #51838

Changelog: Prevent Teleport proxy failing to initialize when listener address's host component is empty.

This PR fixes an issue caused by configuring Teleport proxy listener
address without a host `:443` or in ipv6 form `[::]:443`.

The call to `utils.SplitHostPort` was checking if the host was empty
after the split which caused proxies to fail to initialize.

`:443` is equivalent to `0.0.0.0:443`.

Fixes #51838

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Comment thread lib/kube/grpc/utils.go
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
@tigrato tigrato added this pull request to the merge queue Feb 4, 2025
Merged via the queue into master with commit 65afb94 Feb 4, 2025
@tigrato tigrato deleted the tigrato/fix-host-parse-kube-api branch February 4, 2025 20:26
@public-teleport-github-review-bot
Copy link
Copy Markdown

@tigrato See the table below for backport results.

Branch Result
branch/v15 Failed
branch/v16 Failed
branch/v17 Create PR

carloscastrojumo pushed a commit to carloscastrojumo/teleport that referenced this pull request Feb 19, 2025
…ed (gravitational#51839)

* kube: prevent init failure when proxy listener addr host is unspecified

This PR fixes an issue caused by configuring Teleport proxy listener
address without a host `:443` or in ipv6 form `[::]:443`.

The call to `utils.SplitHostPort` was checking if the host was empty
after the split which caused proxies to fail to initialize.

`:443` is equivalent to `0.0.0.0:443`.

Fixes gravitational#51838

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>

* Update utils.go

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>

---------

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy fails to initialize with empty hostname

3 participants