Merge "[ceph-client] Add the ability to run Ceph commands from values"

This commit is contained in:
Zuul 2022-07-19 06:49:33 +00:00 committed by Gerrit Code Review
commit 381d066f01
4 changed files with 15 additions and 3 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Ceph Client
name: ceph-client
version: 0.1.35
version: 0.1.36
home: https://github.com/ceph/ceph-client
...

View File

@ -175,7 +175,7 @@ function disable_autoscaling () {
}
function set_cluster_flags () {
if [[ ! -z "${CLUSTER_SET_FLAGS}" ]]; then
if [[ -n "${CLUSTER_SET_FLAGS}" ]]; then
for flag in ${CLUSTER_SET_FLAGS}; do
ceph osd set ${flag}
done
@ -183,13 +183,19 @@ function set_cluster_flags () {
}
function unset_cluster_flags () {
if [[ ! -z "${CLUSTER_UNSET_FLAGS}" ]]; then
if [[ -n "${CLUSTER_UNSET_FLAGS}" ]]; then
for flag in ${CLUSTER_UNSET_FLAGS}; do
ceph osd unset ${flag}
done
fi
}
function run_cluster_commands () {
{{- range .Values.conf.features.cluster_commands }}
ceph --cluster "${CLUSTER}" {{ . }}
{{- end }}
}
# Helper function to set pool properties only if the target value differs from
# the current value to optimize performance
function set_pool_property() {
@ -328,6 +334,7 @@ function convert_to_bytes() {
set_cluster_flags
unset_cluster_flags
run_cluster_commands
reweight_osds
{{ $targetOSDCount := .Values.conf.pool.target.osd }}

View File

@ -229,6 +229,10 @@ conf:
# List of flags to set or unset separated by spaces
set: ""
unset: ""
cluster_commands:
# Add additional commands to run against the Ceph cluster here
- osd require-osd-release octopus
- status
pool:
# NOTE(portdirect): this drives a simple approximation of
# https://ceph.com/pgcalc/, the `target.osd` key should be set to match the

View File

@ -36,4 +36,5 @@ ceph-client:
- 0.1.33 More robust naming of clusterrole-checkdns
- 0.1.34 Migrated CronJob resource to batch/v1 API version
- 0.1.35 Handle multiple mon versions in the pool job
- 0.1.36 Add the ability to run Ceph commands from values
...