Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI inject/uninject extraction of workload parser and injection methods
- Extracted from `/cli/cmd/inject.go` and `/cli/cmd/inject_util.go` the core methods doing the workload parsing and injection, and moved them into `/pkg/inject/inject.go`. The CLI files should now deal only with strictly CLI concerns, and applying the json patch returned by the new lib. - Proceeded analogously with `/cli/cmd/uninject.go` and `/pkg/inject/uninject.go`. - The `InjectReport` struct and helping methods were moved into `/pkg/inject/report.go` The only network call `/pkg/inject/inject.go` does is inside `shouldInject()` where it retrieves the namespace annotations from kubernetes. I think we need to review how that client is created in there. Caveats: - Currently passing aroung GlobalConfig and ProxyConfig and using their GRPC methods directly, until we come up with an abstraction for all that. - I removed support for parsing yamls with List containing multiple workloads because it was not an easy refactor given the recursion. I'll re-add that later on. - Todo: fix all the tests. - I've made a note to remove later on the bad v1 import alias that VSCode is adding. Ref #1748 and #2289 Signed-off-by: Alejandro Pedraza <[email protected]>
- Loading branch information