KusionStack / karpor

Intelligence for Kubernetes. World's most promising Kubernetes Visualization Tool for Developer and Platform Engineering teams.
https://karpor-demo.kusionstack.io
Apache License 2.0
678 stars 52 forks source link

refactor(syncer): refine transform function #606

Closed iamryanchia closed 2 months ago

iamryanchia commented 3 months ago

What type of PR is this?

/kind refactor

What this PR does / why we need it:

The current transform function has two capabilities: trimming to save informer memory and influencing data stored in ES. This PR splits these two capabilities into two stages, making the function definition clearer and having the following advantages:

  1. The first stage uses jsonPath instead of go template, which is easier for users to use and less prone to errors, and ensures that the data in the informer is a subset of the original object.

  2. The second stage can use workqueue to retry retryable errors that occur during the transformation process.

Which issue(s) this PR fixes:

Fixes #