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

feat: test backup directory is writable to avoid chown #548

Merged
merged 2 commits into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion controllers/util/solr_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ func generateSolrSetupInitContainers(solrCloud *solr.SolrCloud, solrCloudStatus
},
}
setupCommands := []string{"cp /tmp/solr.xml /tmp-config/solr.xml"}
setupCommands = append(setupCommands, fmt.Sprintf("adduser -u %d -H -D solr", DefaultSolrUser))

// Add prep for backup-restore Repositories
// This entails setting the correct permissions for the directory
Expand All @@ -627,7 +628,8 @@ func generateSolrSetupInitContainers(solrCloud *solr.SolrCloud, solrCloudStatus
volumeMounts = append(volumeMounts, *volumeMount)

setupCommands = append(setupCommands, fmt.Sprintf(
"chown -R %d:%d %s",
"(su solr -c 'test -w %s' || chown -R %d:%d %s)",
volumeMount.MountPath,
DefaultSolrUser,
DefaultSolrGroup,
volumeMount.MountPath))
Expand Down
7 changes: 7 additions & 0 deletions helm/solr-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ annotations:
url: https://github.com/apache/solr-operator/issues/477
- name: GitHub PR
url: https://github.com/apache/solr-operator/pull/546
- kind: fixed
description: Avoid backup directory chown when directories are already writable
links:
- name: GitHub Issue
url: https://github.com/apache/solr-operator/issues/537
- name: GitHub PR
url: https://github.com/apache/solr-operator/pull/548
artifacthub.io/images: |
- name: solr-operator
image: apache/solr-operator:v0.7.0-prerelease
Expand Down