fix: initialize port-forward namespace and address flags from provide… - #1937
Samyra312007 wants to merge 3 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @Samyra312007! It looks like this is your first PR to kmesh-net/kmesh 🎉 |
…d args Signed-off-by: Samyra312007 <samayra312007@gmail.com>
55d0a9e to
8d057b8
Compare
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (52.63%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
/retest |
…rwarder config loader wrapper Signed-off-by: Samyra312007 <samayra312007@gmail.com>
639da56 to
8fff353
Compare
Signed-off-by: Samyra312007 <samayra312007@gmail.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixes
pkg/kube.NewPortForwarder()so thatnewPortForwarder()initializes the Cobranamespaceandaddressflags from thensandlocalAddressarguments passed by the caller instead of the hardcodedKmeshNamespace(kmesh-system) andDefaultLocalAddress(localhost) defaults.Previously the supplied namespace and bind address were stored in the
portForwarderstruct but never reflected in the Cobra flags, so the port-forward command bound tolocalhostregardless of the requestedlocalAddressand exposed an inconsistentnamespaceflag value. Existing callers pass""/kmesh-system, so behavior is preserved for them.Also adds unit tests in
pkg/kube/portforwarder_test.gocovering flag initialization, the localhost fallback, dynamic port selection, and struct field population.Which issue(s) this PR fixes:
Fixes #1879
Special notes for your reviewer:
NONE
Does this PR introduce a user-facing change?: