-
Notifications
You must be signed in to change notification settings - Fork 197
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
perf: Optimize cache by minimizing unnecessary data storage. #1405
Conversation
999f3b5
to
cd11a43
Compare
8d0f906
to
914b2e8
Compare
cb0f499
to
67e1d0f
Compare
04de140
to
4d7ff27
Compare
…ug fixes, and memory optimization. Stripped managed fields and last-applied-configuration from resources and cache: Implemented object metadata transformation using `WithTransform` in `NewSharedInformerFactoryWithOptions` for shared informers. ref: informers package - k8s.io/client-go/informers - Go Packages Updated the controller runtime manager cache to include `DefaultTransform`, leveraging `TransformStripManagedFields()` along with logic to remove the last-applied-configuration annotation for all cached objects. ref: cache package - sigs.k8s.io/controller-runtime/pkg/cache - Go Packages These changes ensure that unwanted metadata is removed from objects before they are stored in the cache, optimizing memory usage and improving performance.
4d7ff27
to
346a38a
Compare
@@ -36,34 +35,6 @@ type Inputs struct { | |||
func VulnerabilityScannerBehavior(inputs *Inputs) func() { | |||
return func() { | |||
|
|||
Context("When unmanaged Pod is created", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to remove this test case
@@ -79,15 +50,15 @@ func VulnerabilityScannerBehavior(inputs *Inputs) func() { | |||
|
|||
err := inputs.Create(ctx, deploy) | |||
Expect(err).ToNot(HaveOccurred()) | |||
Eventually(inputs.HasActiveReplicaSet(inputs.PrimaryNamespace, deploy.Name), inputs.AssertTimeout).Should(BeTrue()) | |||
Eventually(inputs.HasActiveReplicaSet(inputs.PrimaryNamespace, deploy.Name), 300*time.Second).Should(BeTrue()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see we are updating AssertTimeout to 5min, so we dont need this change here. Let it come from inputs.Asserttimeout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will address in the next commit.
Updates to controller-runtime and client-go for better performance, bug fixes, and memory optimization.
Stripped managed fields and last-applied-configuration from resources and cache:
WithTransform
inNewSharedInformerFactoryWithOptions
for shared informers. ref: informers package - k8s.io/client-go/informers - Go PackagesDefaultTransform
, leveragingTransformStripManagedFields()
along with logic to remove the last-applied-configuration annotation for all cached objects. ref: cache package - sigs.k8s.io/controller-runtime/pkg/cache - Go PackagesAdditionally, fixed failing unit test cases.