Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] components' script volume mount has wrong permission #7298

Closed
cjc7373 opened this issue May 10, 2024 · 0 comments · Fixed by #7405
Closed

[BUG] components' script volume mount has wrong permission #7298

cjc7373 opened this issue May 10, 2024 · 0 comments · Fixed by #7405
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@cjc7373
Copy link
Contributor

cjc7373 commented May 10, 2024

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:

func buildVolumeMode(configs []string, name string, configSpec appsv1alpha1.ComponentTemplateSpec) *int32 {
if !viper.GetBool(constant.FeatureGateIgnoreConfigTemplateDefaultMode) {
return configSpec.DefaultMode
}
if slices.Contains(configs, name) {
return &configsDefaultMode
}
return &scriptsDefaultMode
}

@cjc7373 cjc7373 added the kind/bug Something isn't working label May 10, 2024
@sophon-zt sophon-zt linked a pull request May 22, 2024 that will close this issue
@github-actions github-actions bot added this to the Release 0.8.3 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants