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

[FIX] getHostIP: fix failing on DfD and init new host.k3d.internal injection #872

Merged
merged 2 commits into from
Dec 3, 2021

Conversation

iwilltry42
Copy link
Member

@iwilltry42 iwilltry42 commented Nov 29, 2021

Changes

  • do not close connection of exec process before having read everything
    • as a backwards-compatible fix, we now read all logs into a new
      bufio.Reader so we can savely close the connection and original reader
  • start tools node with --add-host=host.k3d.internal:host-gateway
    (docker feature) and use it for getHostIP on DfD (TODO: we can use this
    on all platforms)

To-Do

  • if DfD && local (i.e. no non-local tcp/ssh connection) && host.docker.internal resolvable locally; then host.docker.internal in kubeconfig
    • Problem: e.g. in WSL2, all of the above conditions are true, but host.docker.internal is not reachable
      • Pinging it with a library would draw in unnecessary dependencies
      • As an alternative check, we just look if the WSL_DISTRO_NAME env var is present to determine if k3d is running in WSL2 and if so, we do not use host.docker.internal

Links

- do not close connection of exec process before having read everything
  - as a backwards-compatible fix, we now read all logs into a new
  bufio.Reader so we can savely close the connection and original reader
- start tools node with --add-host=host.k3d.internal:host-gateway
(docker feature) and use it for getHostIP on DfD (TODO: we can use this
on all platforms)
@iwilltry42 iwilltry42 added bug Something isn't working enhancement New feature or request priority/high scope/package pkg/ labels Nov 29, 2021
@iwilltry42 iwilltry42 added this to the v5.1.1 milestone Nov 29, 2021
@iwilltry42 iwilltry42 self-assigned this Nov 29, 2021
@iwilltry42 iwilltry42 force-pushed the enhancement/docker-variants branch 5 times, most recently from 59eb8b7 to d29d433 Compare December 3, 2021 08:58
@iwilltry42 iwilltry42 force-pushed the enhancement/docker-variants branch from d29d433 to 3e080d3 Compare December 3, 2021 09:03
@iwilltry42 iwilltry42 marked this pull request as ready for review December 3, 2021 09:20
@iwilltry42 iwilltry42 merged commit 49705f1 into main Dec 3, 2021
@iwilltry42 iwilltry42 deleted the enhancement/docker-variants branch December 3, 2021 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request priority/high scope/package pkg/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] WSL2: host.k3d.internal warning & failed kubectl connection at 0.0.0.0
1 participant