Skip to content

chore(chart): rename values key runtime.cache to runtime.cacheruntime - #6137

Merged
RongGu merged 1 commit into
fluid-cloudnative:masterfrom
cheyang:chore/rename-values-key-cacheruntime
Jul 28, 2026
Merged

chore(chart): rename values key runtime.cache to runtime.cacheruntime#6137
RongGu merged 1 commit into
fluid-cloudnative:masterfrom
cheyang:chore/rename-values-key-cacheruntime

Conversation

@cheyang

@cheyang cheyang commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

What this PR does

Renames the Helm values key for the CacheRuntime controller: runtime.cacheruntime.cacheruntime.

Why

The sub-keys under runtime: are named after cache engines — alluxio, jindo, juicefs, thin, efc, vineyard. A sibling named cache therefore reads like yet another engine, while CacheRuntime is actually a mechanism: it integrates arbitrary cache systems declaratively through CacheRuntimeClass (topology + executionEntries), rather than being one more built-in engine.

There is also a concrete readability trap: cache in the Kubernetes ecosystem usually means the client-go informer cache, so

runtime:
  cache:
    kubeClientQPS: 20
    workQueueQPS: 10

reads like controller cache tuning rather than settings of the CacheRuntime controller.

runtime.cacheruntime stutters slightly under runtime:, but it lines up exactly with the CRD (cacheruntimes.data.fluid.io), the Deployment (cacheruntime-controller) and the binary, so there is no ambiguity left.

Compatibility

The old key never shipped in a release tag (latest tag is v1.0.8; CacheRuntime exists only on master), so no compatibility shim is needed. Instead the template now fails the render when a stale runtime.cache is present:

Error: UPGRADE FAILED: execution error at (fluid/templates/controller/cacheruntime_controller.yaml:2:4):
values key `runtime.cache` has been renamed to `runtime.cacheruntime`, please update your values file or --set flags

Without that guard the old key would silently render replicas: 0 and scale the controller down with no error at all — which is exactly what happens to anyone on master who keeps runtime.cache.enabled: true in their values.

Verification

Tested against a live 3-node Kubernetes v1.36 cluster running Fluid from master:

  1. Rendered output is unchanged. With the chart's defaultVersion pinned to the images the cluster was already running, the manifest produced by helm upgrade --dry-run is byte-identical to helm get manifest fluid (2837 lines, same md5) — the rename touches only the values layer, no rendered object changes.
  2. Real upgrade works. helm upgrade succeeded, helm get values now shows runtime.cacheruntime.enabled: true, cacheruntime-controller stayed 1/1 and its pod was not even restarted.
  3. Guard works. --set runtime.cache.enabled=true fails loudly (message above); the new key renders replicas: 1; the default renders replicas: 0.

.github/scripts/deploy-fluid-to-kind.sh is updated to the new key as well; no other references to the old key remain in the repo (docs, tests, CI, Makefile all checked).

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the Helm chart values key for configuring the CacheRuntime controller from runtime.cache to runtime.cacheruntime, aligning the values structure with the controller/CRD naming and reducing ambiguity.

Changes:

  • Renamed the runtime.cache values subtree to runtime.cacheruntime in values.yaml.
  • Updated the CacheRuntime controller Deployment template to read from runtime.cacheruntime and added a render-time guard for stale runtime.cache usage.
  • Updated the Kind deployment helper script to use --set runtime.cacheruntime.enabled=true.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
charts/fluid/fluid/values.yaml Renames the values subtree and adds clarifying comments for the CacheRuntime controller settings.
charts/fluid/fluid/templates/controller/cacheruntime_controller.yaml Switches template lookups to runtime.cacheruntime and adds a guard to fail on deprecated runtime.cache.
.github/scripts/deploy-fluid-to-kind.sh Updates Helm --set usage to the new values key.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +3
{{- if .Values.runtime.cache }}
{{- fail "values key `runtime.cache` has been renamed to `runtime.cacheruntime`, please update your values file or --set flags" }}
{{- end }}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in ba76963. The guard now tests for the presence of the key instead of a truthy value:

{{- if hasKey .Values.runtime "cache" }}
{{- fail "values key `runtime.cache` has been renamed to `runtime.cacheruntime`, please update your values file or --set flags" }}
{{- end }}

Verified against a live cluster, all of these now fail loudly (only the first one did before):

input result
--set runtime.cache.enabled=true fails with the rename message
--set runtime.cache=false fails with the rename message
runtime.cache: {} in a values file fails with the rename message
runtime.cache: null in a values file / --set runtime.cache=null fails with the rename message
--set runtime.cacheruntime.enabled=true renders replicas: 1
no override renders replicas: 0

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.08%. Comparing base (44cfae9) to head (ba76963).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6137   +/-   ##
=======================================
  Coverage   65.08%   65.08%           
=======================================
  Files         485      485           
  Lines       33989    33989           
=======================================
  Hits        22122    22122           
  Misses      10126    10126           
  Partials     1741     1741           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xliuqq xliuqq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@RongGu RongGu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

The sub-keys under `runtime:` are named after cache engines (alluxio,
jindo, juicefs, thin, efc, vineyard), so a sibling named `cache` reads
like yet another engine, while CacheRuntime is actually a mechanism that
integrates cache systems declaratively via CacheRuntimeClass. Worse,
`runtime.cache.kubeClientQPS` / `workQueueQPS` look like informer cache
tuning knobs rather than settings of the CacheRuntime controller.

Rename the key to `runtime.cacheruntime`, matching the CRD name and the
`cacheruntime-controller` Deployment. The old key never shipped in a
release tag, so no compatibility shim is needed; instead fail the render
loudly whenever the deprecated key is still present, because a leftover
`runtime.cache` would otherwise silently render `replicas: 0` and scale
the controller down without any error. The guard tests for the presence
of the key rather than for a truthy value, so stale but falsy leftovers
such as `runtime.cache: {}` are reported as well.

Signed-off-by: cheyang <cheyang@163.com>
@cheyang
cheyang force-pushed the chore/rename-values-key-cacheruntime branch from 2a05795 to ba76963 Compare July 27, 2026 13:55
@sonarqubecloud

Copy link
Copy Markdown

@cheyang
cheyang requested a review from Copilot July 28, 2026 02:40

@RongGu RongGu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@RongGu
RongGu merged commit e18a6d0 into fluid-cloudnative:master Jul 28, 2026
27 of 29 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

charts/fluid/fluid/templates/controller/cacheruntime_controller.yaml:3

  • hasKey requires its first argument to be a map/dict. If a user supplies an invalid override like runtime: null (or a non-map), this will error out with a type failure before reaching the intended fail message. Consider guarding with a type check (e.g., only call hasKey when .Values.runtime is a map) so the chart fails deterministically with your clearer message.
{{- if hasKey .Values.runtime "cache" }}
{{- fail "values key `runtime.cache` has been renamed to `runtime.cacheruntime`, please update your values file or --set flags" }}
{{- end }}

charts/fluid/fluid/templates/controller/cacheruntime_controller.yaml:27

  • This annotation is currently driven only by replicas > 1, independent of runtime.cacheruntime.enabled. If a user sets replicas: 3 while enabled: false, the Deployment still renders replicas: 0 but retains an annotation suggesting multiple replicas, which is inconsistent and can confuse debugging/operations. Consider gating this condition on enabled as well (or otherwise deriving the annotation from the effective replica count).
      {{ if gt (.Values.runtime.cacheruntime.replicas | int) 1 -}}
        controller.runtime.fluid.io/replicas: {{ .Values.runtime.cacheruntime.replicas | quote }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants