kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[BUG] components' script volume mount has wrong permission

Open cjc7373 opened this issue 1 year ago • 0 comments

kb version: release-0.9 branch latest commit

Describe the bug I'm writing an addon here. In componentdefinition, I'm using scripts field to create a script volume:

spec:
  ....
  scripts:
    - name: tidb-scripts
      templateRef: {{ include "tidb.cmScriptsName" . }}
      namespace: {{ .Release.Namespace }}
      volumeName: scripts

The doc says:

Deprecated: DefaultMode is deprecated since 0.9.0 and will be removed in 0.10.0 for scripts, auto set 0555 for configs, auto set 0444 Refers to the mode bits used to set permissions on created files by default.

So I'm omitting defaultMode field here. However, the pod created has a script volume with wrong permission (which doesn't contain "x" bit).

I suspect the following code causes this inconsistency: https://github.com/apecloud/kubeblocks/blob/7dd0c5439a7b1adc3e74e5a3e8e62334a697189d/pkg/controllerutil/volume_util.go#L109-L117

cjc7373 avatar May 10 '24 08:05 cjc7373