Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(transparent-proxy): simplify more tproxy configuration (#10206)
- Got rid of unnecessary internal `defaultConfig` function We had `defaultConfig` and `DefaultConfig`, where latter was just calling former function. - Simplified configuration handling by removing `MergeConfigWithDefaults` This commit removed the unnecessary and hard-to-maintain `MergeConfigWithDefaults` function. Instead, we now use `DefaultConfig` directly and explicitly set modified values in commands like `kumactl install transparent-proxy` and CNI. I've also streamlined the `transparentProxyArgs` structure by removing parameters that can be directly configured via the `Config` structure. This paves the way for potentially removing this intermediate structure altogether in the future, although that would involve more complex changes in flag parsing. - Added `StoreFirewalld` parameter to `Config` structure I think it's the logical place for this value as it's basically part of the configuration. - Replaced writes to Writers with pure `fmt.Fprintln` to make code cleaner We don't have to cast string literals to `[]byte` now and don't have to explicitly ignore errors. Signed-off-by: Bart Smykla <bartek@smykla.com> Signed-off-by: Ilya Lobkov <ilya.lobkov@konghq.com>
- Loading branch information