From a0aec27ebcb50031bfe0a611343634f480007c6b Mon Sep 17 00:00:00 2001 From: "Parsons, Cliff (cp769u)" Date: Tue, 24 Aug 2021 22:37:57 +0000 Subject: [PATCH] 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 --- ceph-client/Chart.yaml | 2 +- ceph-client/templates/bin/utils/_checkDNS.sh.tpl | 2 +- ceph-mon/Chart.yaml | 2 +- ceph-mon/templates/bin/utils/_checkDNS.sh.tpl | 2 +- ceph-osd/Chart.yaml | 2 +- ceph-osd/templates/bin/utils/_checkDNS.sh.tpl | 2 +- releasenotes/notes/ceph-client.yaml | 1 + releasenotes/notes/ceph-mon.yaml | 1 + releasenotes/notes/ceph-osd.yaml | 1 + 9 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ceph-client/Chart.yaml b/ceph-client/Chart.yaml index 17b33bb8d..347b9bc52 100644 --- a/ceph-client/Chart.yaml +++ b/ceph-client/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Client name: ceph-client -version: 0.1.20 +version: 0.1.21 home: https://github.com/ceph/ceph-client ... diff --git a/ceph-client/templates/bin/utils/_checkDNS.sh.tpl b/ceph-client/templates/bin/utils/_checkDNS.sh.tpl index 1fc6ff7ed..b7e360b2f 100644 --- a/ceph-client/templates/bin/utils/_checkDNS.sh.tpl +++ b/ceph-client/templates/bin/utils/_checkDNS.sh.tpl @@ -20,7 +20,7 @@ ENDPOINT="{$1}" function check_mon_dns () { 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" elif [[ "${ENDPOINT}" != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then diff --git a/ceph-mon/Chart.yaml b/ceph-mon/Chart.yaml index 1f080df90..af94548e1 100644 --- a/ceph-mon/Chart.yaml +++ b/ceph-mon/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph Mon name: ceph-mon -version: 0.1.11 +version: 0.1.12 home: https://github.com/ceph/ceph ... diff --git a/ceph-mon/templates/bin/utils/_checkDNS.sh.tpl b/ceph-mon/templates/bin/utils/_checkDNS.sh.tpl index 1fc6ff7ed..b7e360b2f 100644 --- a/ceph-mon/templates/bin/utils/_checkDNS.sh.tpl +++ b/ceph-mon/templates/bin/utils/_checkDNS.sh.tpl @@ -20,7 +20,7 @@ ENDPOINT="{$1}" function check_mon_dns () { 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" elif [[ "${ENDPOINT}" != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then diff --git a/ceph-osd/Chart.yaml b/ceph-osd/Chart.yaml index f00154d68..b9150f552 100644 --- a/ceph-osd/Chart.yaml +++ b/ceph-osd/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Ceph OSD name: ceph-osd -version: 0.1.28 +version: 0.1.29 home: https://github.com/ceph/ceph ... diff --git a/ceph-osd/templates/bin/utils/_checkDNS.sh.tpl b/ceph-osd/templates/bin/utils/_checkDNS.sh.tpl index 1fc6ff7ed..b7e360b2f 100644 --- a/ceph-osd/templates/bin/utils/_checkDNS.sh.tpl +++ b/ceph-osd/templates/bin/utils/_checkDNS.sh.tpl @@ -20,7 +20,7 @@ ENDPOINT="{$1}" function check_mon_dns () { 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" elif [[ "${ENDPOINT}" != "" ]]; then if [[ ${GREP_CMD} != "" ]]; then diff --git a/releasenotes/notes/ceph-client.yaml b/releasenotes/notes/ceph-client.yaml index cadfa78f5..0b81e8121 100644 --- a/releasenotes/notes/ceph-client.yaml +++ b/releasenotes/notes/ceph-client.yaml @@ -21,4 +21,5 @@ ceph-client: - 0.1.18 Add pool delete support for Ceph pools - 0.1.19 Use full image ref for docker official images - 0.1.20 Export crash dumps when Ceph daemons crash + - 0.1.21 Fix Ceph checkDNS script ... diff --git a/releasenotes/notes/ceph-mon.yaml b/releasenotes/notes/ceph-mon.yaml index 01e0fb0e7..26170b138 100644 --- a/releasenotes/notes/ceph-mon.yaml +++ b/releasenotes/notes/ceph-mon.yaml @@ -12,4 +12,5 @@ ceph-mon: - 0.1.9 Remove unnecessary parameters for ceph-mon - 0.1.10 Export crash dumps when Ceph daemons crash - 0.1.11 Correct mon-check executing binary and logic + - 0.1.12 Fix Ceph checkDNS script ... diff --git a/releasenotes/notes/ceph-osd.yaml b/releasenotes/notes/ceph-osd.yaml index 73c52843e..898977226 100644 --- a/releasenotes/notes/ceph-osd.yaml +++ b/releasenotes/notes/ceph-osd.yaml @@ -29,4 +29,5 @@ ceph-osd: - 0.1.26 Mount /var/crash inside ceph-osd pods - 0.1.27 Limit Ceph OSD Container Security Contexts - 0.1.28 Change var crash mount propagation to HostToContainer + - 0.1.29 Fix Ceph checkDNS script ...