Use feature gates for host pid - #6072
Conversation
Signed-off-by: xliuqq <xlzq1992@gmail.com>
Signed-off-by: xliuqq <xlzq1992@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a new feature gate, RuntimeFuseHostPID, which controls whether the runtime.fluid.io/fuse.hostpid annotation can enable hostPID in FUSE DaemonSets. It adds --feature-gates command-line flags to alluxio, jindo, juicefs, thin, and vineyard runtime controllers, registers the feature gate flag in the controller binaries, and updates the Helm chart templates and values.yaml accordingly. The feedback suggests wrapping the --feature-gates flag in conditional Helm blocks for all controllers to prevent rendering empty flags when the feature gate value is undefined, which could cause parsing errors or container startup failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6072 +/- ##
==========================================
- Coverage 64.77% 64.77% -0.01%
==========================================
Files 484 485 +1
Lines 33892 33902 +10
==========================================
+ Hits 21954 21959 +5
- Misses 10215 10220 +5
Partials 1723 1723 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| // HostPIDEnabled check if HostPID is true for runtime fuse pod. | ||
| func HostPIDEnabled(annotations map[string]string) bool { | ||
| if !utilfeature.DefaultFeatureGate.Enabled(features.RuntimeFuseHostPID) { |
There was a problem hiding this comment.
After this PR, any cluster that today relies on runtime.fluid.io/fuse.hostpid: "true" to start FUSE pods with hostPID will silently stop doing so on upgrade unless the operator also flips RuntimeFuseHostPID=true via the Helm chart. The change is intentional (this is the CVE mitigation) and the secure default is correct, but please make sure a release note / upgrade-notes entry calls this out prominently so existing users aren't surprised. Linking the CVE ID in the PR description would also help downstream consumers triage faster.
There was a problem hiding this comment.
where to document it ? what's the CVE ID?
| } | ||
|
|
||
| func init() { | ||
| runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(defaultFeatureGates)) |
There was a problem hiding this comment.
Each runtime controller (alluxio, jindo, juicefs, thin, vineyard) blank-imports pkg/common/features and exposes the same --feature-gates flag with an identical default. That works fine, but if more runtime-shared gates land later, the operator-facing surface multiplies (one flag per binary). Did you consider keeping a single shared gates package with a registration helper, or is the per-controller binding intentional so each runtime can ship divergent gates down the road? Not blocking — just want to understand the design intent before more gates pile on.
There was a problem hiding this comment.
The current design is reasonable because:
- Fluid's runtimes are truly independent components, each evolving at its own pace.
- In terms of Feature Gate semantics, each runtime controller is deployment-isolated (different Deployments, different Helm values keys).
- If there truly is a cross-runtime shared gate in the future, it can be defined once in
pkg/common/features, and each runtime continues to register it independently (only one definition needed, not a shared registration entry point).
…ature gate test recoverable Signed-off-by: xliuqq <xlzq1992@gmail.com>
|
|
Re-reviewed at f0da9ee. Thanks for the quick follow-up — the prior notes are addressed:
No new blockers from my side. Heads-up: |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RongGu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



Ⅰ. Describe what this PR does
Add a
RuntimeFuseHostPIDfeature gate to control whether theruntime.fluid.io/fuse.hostpidannotation on Runtime CRs can enablehostPID: truein FUSE DaemonSets. Each runtime engine has its own featureGates configuration in Helm values, allowing administrators to enable/disable this feature per engine. Defaults tofalse(disabled) for security.Ⅱ. Does this pull request fix one issue?
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
HostPIDEnabledwith feature gate on/off