Skip to content

ROX-33361: Per-namespace persistence for process indicators#19957

Merged
erthalion merged 1 commit intomasterfrom
feature/per-namespace-persistence
Apr 17, 2026
Merged

ROX-33361: Per-namespace persistence for process indicators#19957
erthalion merged 1 commit intomasterfrom
feature/per-namespace-persistence

Conversation

@erthalion
Copy link
Copy Markdown
Contributor

@erthalion erthalion commented Apr 13, 2026

Description

NOTE: It's been split from #19455, for the purposes of simplifying the review. The PR contains only the first commit, introducing the actual machinery. The implementation is exactly the same as in the original PR.

Allow to configure per-namespace persistence for process indicators, so that Central wouldn't need to store information, which never will be used.

It could be configured via DynamicConfig of the cluster configuration in the form:

message ProcessIndicators {
  string namespace_filter = 1;
  bool exclude_openshift_ns = 2;
  bool persistence = 3;
}

Where namespace_filter allows to specify a custom regex to filter out processes by matching namespace, exclude_openshift_ns instructs Central to exclude anything from openshift-* namespaces, and persistence can be used to disable storing process indicators at all.

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

Manual validation (creating an operator-managed cluster and modifying the configuration), as well as E2E tests. Split from #19455 to simplify the review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 13, 2026

🚀 Build Images Ready

Images are ready for commit 405c8cf. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-688-g405c8cf703

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 48.06202% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.69%. Comparing base (7b58df2) to head (7f1e4bd).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
central/graphql/resolvers/generated.go 13.04% 40 Missing ⚠️
central/cluster/datastore/datastore_impl.go 51.16% 19 Missing and 2 partials ⚠️
central/detection/lifecycle/manager_impl.go 75.00% 2 Missing and 1 partial ⚠️
pkg/cluster/filtering.go 88.88% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19957      +/-   ##
==========================================
+ Coverage   49.67%   49.69%   +0.01%     
==========================================
  Files        2765     2766       +1     
  Lines      209049   209175     +126     
==========================================
+ Hits       103847   103950     +103     
- Misses      97523    97538      +15     
- Partials     7679     7687       +8     
Flag Coverage Δ
go-unit-tests 49.69% <48.06%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@erthalion erthalion force-pushed the feature/per-namespace-persistence branch from 680576b to e2ec42b Compare April 13, 2026 14:00
@erthalion
Copy link
Copy Markdown
Contributor Author

/test ocp-4-21-qa-e2e-tests

Comment thread proto/storage/cluster.proto Outdated
Comment thread proto/storage/cluster.proto Outdated
@erthalion erthalion force-pushed the feature/per-namespace-persistence branch 2 times, most recently from 57f2aa8 to cad5788 Compare April 14, 2026 10:22
@erthalion erthalion requested a review from porridge April 14, 2026 12:59
@erthalion
Copy link
Copy Markdown
Contributor Author

The only failing tests are flake #19959

Comment thread proto/storage/cluster.proto Outdated
Comment thread central/cluster/datastore/datastore_impl.go
Comment thread central/cluster/datastore/datastore_impl.go
Comment thread pkg/cluster/filtering.go Outdated
Comment thread pkg/cluster/filtering.go Outdated
@erthalion erthalion force-pushed the feature/per-namespace-persistence branch 3 times, most recently from eda56d2 to f03bc24 Compare April 15, 2026 12:16
@erthalion erthalion requested a review from dashrews78 April 15, 2026 13:11
@erthalion
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 16, 2026

@erthalion: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ocp-4-21-qa-e2e-tests f03bc24 link false /test ocp-4-21-qa-e2e-tests
ci/prow/ocp-4-12-qa-e2e-tests f03bc24 link false /test ocp-4-12-qa-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Comment thread central/cluster/datastore/datastore_impl.go
Comment thread pkg/cluster/filtering.go
Comment thread central/detection/lifecycle/manager_impl.go Outdated
Comment thread central/cluster/datastore/datastore.go Outdated
Comment thread pkg/cluster/filtering.go Outdated
Comment thread central/cluster/datastore/datastore_impl.go
@erthalion erthalion force-pushed the feature/per-namespace-persistence branch 3 times, most recently from ef495a3 to 714aadb Compare April 17, 2026 13:13
@erthalion erthalion enabled auto-merge (squash) April 17, 2026 13:29
Allow to configure per-namespace persistence for process indicators, so
that Central wouldn't need to store information, which never will be used.

It could be configured via DynamicConfig of the cluster configuration in
the form:

```
message ProcessIndicators {
  bool no_persistence = 1;
  string exclude_namespace_filter = 2;
  bool exclude_openshift_ns = 3;
}
```

Where `exclude_namespace_filter` allows to specify a custom regex to
filter out processes by matching namespace, `exclude_openshift_ns`
instructs Central to exclude anything from openshift-* namespaces, and
`no_persistence` can be used to disable storing process indicators at all.
@erthalion erthalion force-pushed the feature/per-namespace-persistence branch from 714aadb to 7f1e4bd Compare April 17, 2026 13:33
@erthalion erthalion merged commit 405c8cf into master Apr 17, 2026
98 of 103 checks passed
@erthalion erthalion deleted the feature/per-namespace-persistence branch April 17, 2026 15:57
erthalion added a commit that referenced this pull request Apr 20, 2026
Commit 405c8cf ("ROX-33361: Per-namespace persistence for process
indicators (#19957)") has introduced a possibility to configure
per-namespace persistence for process indicators, but did not wire it up
anywhere.

Allow to provide new dynamic config fields via SecuredCluster CR, in the
form:

    spec:
      processIndicators:
        persistence: true
        excludeNamespaceFilter: namespace-without-persistence
        excludeOpenshiftNs: false

It works in exactly the same way as above mentioned dynamic config
counterpart, except the reversed "persistence" field. Contrary to a
protobuf dynamic config, SecuredCluster CR allows to distinguish not set
values, thus we choose more natural to read version. It will be
converted into the "noPersistence" during translation.
erthalion added a commit that referenced this pull request Apr 21, 2026
Commit 405c8cf ("ROX-33361: Per-namespace persistence for process
indicators (#19957)") has introduced a possibility to configure
per-namespace persistence for process indicators, but did not wire it up
anywhere.

Allow to provide new dynamic config fields via SecuredCluster CR, in the
form:

    spec:
      processIndicators:
        persistence: true
        excludeNamespaceFilter: namespace-without-persistence
        excludeOpenshiftNs: false

It works in exactly the same way as above mentioned dynamic config
counterpart, except the reversed "persistence" field. Contrary to a
protobuf dynamic config, SecuredCluster CR allows to distinguish not set
values, thus we choose more natural to read version. It will be
converted into the "noPersistence" during translation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants