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

feat(transparent-proxy): allow --kuma-dp-user to accept UIDs and deprecate --kuma-dp-uid flag #10920

Merged
merged 8 commits into from
Jul 17, 2024

Conversation

bartsmykla
Copy link
Contributor

@bartsmykla bartsmykla commented Jul 17, 2024

Move Owner UID/Username Processing to Config

  • Enhanced --kuma-dp-user Flag:
    • The --kuma-dp-user flag in kumactl install transparent-proxy now accepts both usernames and UIDs.
    • The --kuma-dp-uid flag has been deprecated in favor of the enhanced --kuma-dp-user flag.
    • The --kuma-dp-user flag is now optional. If not specified, the system will attempt to use a default UID (5678) or the default username (kuma-dp).
    • The logic for processing user information (searching for the user) has been moved to the transparent proxy Config.

Small Improvements and Refactorings

  • Add IPFamilyMode to Config and Remove IPv6 Field:

    • Replaced the IPv6 field in Config with the IPFamilyMode field.
    • This change centralizes the processing of IP family modes within the Config struct, simplifying the configuration and usage.
  • Unembed Executables from InitializedExecutables:

    • Removed the embedding of the Executables struct from InitializedExecutables.
    • The fields from Executables are not used directly in InitializedExecutables, and unembedding helps to reduce clutter and improve code clarity.
  • Adjust Unit Tests for kumactl install transparent-proxy:

    • Updated the unit tests to align with recent changes in handling IPv4 and IPv6 rules generation.
    • Removed the use of subnetPlaceholder and unified the IP address for inbound traffic in tests, as there is no different inbound redirection port for IPv6 now.

Checklist prior to review

  • Link to relevant issue as well as docs and UI issues
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS
    • It won't
  • Tests (Unit test, E2E tests, manual test on universal and k8s)
    • Existing unit tests adjusted
    • Manually tested on local Ubuntu:24.04 container
    • Don't forget ci/ labels to run additional/fewer tests
  • Do you need to update UPGRADE.md?
    • Updated
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label)
    • There is no need

Removing the embedding of the `Executables` struct from
`InitializedExecutables` as it is unnecessary. The fields from
`Executables` are not used directly in `InitializedExecutables`, and
unembedding helps to reduce clutter and improve code clarity.

Signed-off-by: Bart Smykla <[email protected]>
Replaced the `IPv6` field in `Config` with the `IPFamilyMode` field.
This change centralizes the processing of IP family modes within the
`Config` struct, simplifying the configuration and usage.

Signed-off-by: Bart Smykla <[email protected]>
Updated the unit tests to align with recent changes in handling IPv4
and IPv6 rules generation. Removed the use of `subnetPlaceholder` and
unified the IP address for inbound traffic in tests, as there is no
different inbound redirection port for IPv6 now.

Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla bartsmykla added ci/skip-e2e-test PR: Don't run e2e tests ci/run-full-matrix PR: Runs all possible e2e test combination (expensive use carefully) and removed ci/skip-e2e-test PR: Don't run e2e tests labels Jul 17, 2024
@bartsmykla bartsmykla changed the title refactor(transparent-proxy): improvements in tproxy config feat(transparent-proxy): allow --kuma-dp-user to accept UIDs and deprecate --kuma-dp-uid flag Jul 17, 2024
- Allow `--kuma-dp-user` flag in `kumactl install transparent-proxy` to
  accept both usernames and UIDs.
- Deprecate `--kuma-dp-uid` flag in favor of the enhanced
  `--kuma-dp-user` flag.
- Make `--kuma-dp-user` flag optional. If not specified, the system will
  attempt to use a default UID (`5678`) or the default username
  (`kuma-dp`).
- Relocate the user processing logic (searching for the user) to the
  transparent proxy Config.

Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla bartsmykla marked this pull request as ready for review July 17, 2024 06:55
@bartsmykla bartsmykla requested a review from a team as a code owner July 17, 2024 06:55
@bartsmykla bartsmykla requested review from michaelbeaumont and jakubdyszkiewicz and removed request for a team July 17, 2024 06:55
@bartsmykla bartsmykla enabled auto-merge (squash) July 17, 2024 09:49
@bartsmykla bartsmykla disabled auto-merge July 17, 2024 09:52
@bartsmykla bartsmykla merged commit 71e682c into master Jul 17, 2024
35 checks passed
@bartsmykla bartsmykla deleted the refactor/improvements-in-tproxy-config branch July 17, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-full-matrix PR: Runs all possible e2e test combination (expensive use carefully)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants