Skip to content

feat(connect): support for listen address on zarf connect #3914

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

brandtkeller
Copy link
Member

@brandtkeller brandtkeller commented Jun 13, 2025

Description

Adds the ability to specify a listening address for binding the tunnel connection. This allows users to specify other addresses than the hardcoded localhost/127.0.0.1 in such a way as to bind to all interfaces for connectivity on the zarf CLI machine.

IE zarf connect <target> --address 0.0.0.0 to bind to all interfaces.

Primarily this replaces the use of portforward.New() which has localhost hardcoded and calls portforward.NewOnAddresses() with directly calling portfoward.NewOnAddresses() and ensuring we pass in localhost everywhere except for when overriding.

Minor Note - added ls alias to zarf connect list command as this follows the same patterns seen elsewhere (zarf package ls)

Related Issue

Fixes #3913

Checklist before merging

@brandtkeller brandtkeller self-assigned this Jun 13, 2025
@brandtkeller brandtkeller requested review from a team as code owners June 13, 2025 16:06
Copy link

netlify bot commented Jun 13, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 1584819
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/684c579cf20e810008a2c828

Copy link

codecov bot commented Jun 13, 2025

Codecov Report

Attention: Patch coverage is 6.25000% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/cluster/tunnel.go 0.00% 23 Missing ⚠️
src/cmd/connect.go 50.00% 2 Missing ⚠️
src/cmd/internal.go 0.00% 2 Missing ⚠️
src/pkg/cluster/zarf.go 0.00% 2 Missing ⚠️
src/pkg/packager/mirror.go 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/packager/mirror.go 0.00% <0.00%> (ø)
src/cmd/connect.go 32.65% <50.00%> (+0.02%) ⬆️
src/cmd/internal.go 35.62% <0.00%> (ø)
src/pkg/cluster/zarf.go 15.28% <0.00%> (ø)
src/pkg/cluster/tunnel.go 9.97% <0.00%> (-0.11%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brandtkeller brandtkeller marked this pull request as draft June 13, 2025 16:30
@brandtkeller brandtkeller marked this pull request as ready for review June 13, 2025 17:29
@brandtkeller brandtkeller marked this pull request as draft June 14, 2025 03:04
@brandtkeller
Copy link
Member Author

Moving to draft - going to align to kubectl for passing a comma-separated list of addresses as opposed to a single address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add all kubectl port-forward capabilities to zarf connect
1 participant