Fix Ceph checkDNS script

The checkDNS script which is run inside the ceph-mon pods has had
a bug for a while now. If a value of "up" is passed in, it adds
brackets around it, but then doesn't check for the brackets when
checking for a value of "up". This causes a value of "{up}" to be
written into the ceph.conf for the mon_host line and that causes
the mon_host to not be able to respond to ceph/rbd commands. Its
normally not a problem if DNS is working, but if DNS stops working
this can happen.

This patch changes the comparison to look for "{up}" instead of
"up" in three different files, which should fix the problem.

Change-Id: I89cf07b28ad8e0e529646977a0a36dd2df48966d
This commit is contained in:
Parsons, Cliff (cp769u) 2021-08-24 22:37:57 +00:00
parent 6f427495f3
commit a0aec27ebc
9 changed files with 9 additions and 6 deletions

View File

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

View File

@ -20,7 +20,7 @@ ENDPOINT="{$1}"
function check_mon_dns () { function check_mon_dns () {
GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF}) GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF})
if [[ "${ENDPOINT}" == "up" ]]; then if [[ "${ENDPOINT}" == "{up}" ]]; then
echo "If DNS is working, we are good here" echo "If DNS is working, we are good here"
elif [[ "${ENDPOINT}" != "" ]]; then elif [[ "${ENDPOINT}" != "" ]]; then
if [[ ${GREP_CMD} != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph Mon description: OpenStack-Helm Ceph Mon
name: ceph-mon name: ceph-mon
version: 0.1.11 version: 0.1.12
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -20,7 +20,7 @@ ENDPOINT="{$1}"
function check_mon_dns () { function check_mon_dns () {
GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF}) GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF})
if [[ "${ENDPOINT}" == "up" ]]; then if [[ "${ENDPOINT}" == "{up}" ]]; then
echo "If DNS is working, we are good here" echo "If DNS is working, we are good here"
elif [[ "${ENDPOINT}" != "" ]]; then elif [[ "${ENDPOINT}" != "" ]]; then
if [[ ${GREP_CMD} != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph OSD description: OpenStack-Helm Ceph OSD
name: ceph-osd name: ceph-osd
version: 0.1.28 version: 0.1.29
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -20,7 +20,7 @@ ENDPOINT="{$1}"
function check_mon_dns () { function check_mon_dns () {
GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF}) GREP_CMD=$(grep -rl 'ceph-mon' ${CEPH_CONF})
if [[ "${ENDPOINT}" == "up" ]]; then if [[ "${ENDPOINT}" == "{up}" ]]; then
echo "If DNS is working, we are good here" echo "If DNS is working, we are good here"
elif [[ "${ENDPOINT}" != "" ]]; then elif [[ "${ENDPOINT}" != "" ]]; then
if [[ ${GREP_CMD} != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then

View File

@ -21,4 +21,5 @@ ceph-client:
- 0.1.18 Add pool delete support for Ceph pools - 0.1.18 Add pool delete support for Ceph pools
- 0.1.19 Use full image ref for docker official images - 0.1.19 Use full image ref for docker official images
- 0.1.20 Export crash dumps when Ceph daemons crash - 0.1.20 Export crash dumps when Ceph daemons crash
- 0.1.21 Fix Ceph checkDNS script
... ...

View File

@ -12,4 +12,5 @@ ceph-mon:
- 0.1.9 Remove unnecessary parameters for ceph-mon - 0.1.9 Remove unnecessary parameters for ceph-mon
- 0.1.10 Export crash dumps when Ceph daemons crash - 0.1.10 Export crash dumps when Ceph daemons crash
- 0.1.11 Correct mon-check executing binary and logic - 0.1.11 Correct mon-check executing binary and logic
- 0.1.12 Fix Ceph checkDNS script
... ...

View File

@ -29,4 +29,5 @@ ceph-osd:
- 0.1.26 Mount /var/crash inside ceph-osd pods - 0.1.26 Mount /var/crash inside ceph-osd pods
- 0.1.27 Limit Ceph OSD Container Security Contexts - 0.1.27 Limit Ceph OSD Container Security Contexts
- 0.1.28 Change var crash mount propagation to HostToContainer - 0.1.28 Change var crash mount propagation to HostToContainer
- 0.1.29 Fix Ceph checkDNS script
... ...