Replacing the object informer implementation in cache #103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
Enhancement
Description
This PR replaces the object informer implementation in the cache with a pure watcher of Kubernetes objects. The main changes include:
watcher
package.StartController
function and stopped in theDestroy
function.handleApplicationProfile
andhandleDeleteApplicationProfile
functions are updated to handleunstructured.Unstructured
objects.Makefile
is updated to apply the CRDs from thechart/kubecop/crds
directory.kubescape/kapprofiler
dependency is updated to versionv0.0.36
.PR changes walkthrough
1 files
cache.go
pkg/approfilecache/cache.go
The informer is replaced with a watcher in the cache
implementation. The watcher is implemented using the
`watcher` package. The watcher is started in the
`StartController` function and stopped in the `Destroy`
function. The `handleApplicationProfile` and
`handleDeleteApplicationProfile` functions are updated to
handle `unstructured.Unstructured` objects.
1 files
Makefile
Makefile
The `Makefile` is updated to apply the CRDs from the
`chart/kubecop/crds` directory.
2 files
go.mod
go.mod
The `kubescape/kapprofiler` dependency is updated to version
`v0.0.36`.
go.sum
go.sum
The checksum for the `kubescape/kapprofiler` dependency is
updated to match the new version.
User description
Replacing object informer implementation in cache to pure watcher of Kubernetes objects.
This will reduce memory usage since it does not cache everything at the object level in RAM.