Skip to content

Commit

Permalink
Merge pull request #744 from red-hat-storage/sync_us--master
Browse files Browse the repository at this point in the history
Syncing latest changes from upstream master for rook
  • Loading branch information
subhamkrai authored Oct 7, 2024
2 parents e369bf6 + 681f38b commit 5631896
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pkg/operator/ceph/file/mds/livenessprobe.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package mds
import (
"bytes"
_ "embed"
"fmt"
"html/template"

"github.com/pkg/errors"
Expand Down Expand Up @@ -38,6 +37,7 @@ type mdsLivenessProbeConfig struct {
MdsId string
FilesystemName string
Keyring string
CmdTimeout int32
}

func renderProbe(mdsLivenessProbeConfigValue mdsLivenessProbeConfig) (string, error) {
Expand All @@ -64,6 +64,7 @@ func generateMDSLivenessProbeExecDaemon(daemonID, filesystemName, keyring string
MdsId: daemonID,
FilesystemName: filesystemName,
Keyring: keyring,
CmdTimeout: mdsCmdTimeout,
}

mdsLivenessProbeCmd, err := renderProbe(mdsLivenessProbeConfigValue)
Expand All @@ -75,8 +76,6 @@ func generateMDSLivenessProbeExecDaemon(daemonID, filesystemName, keyring string
ProbeHandler: v1.ProbeHandler{
Exec: &v1.ExecAction{
Command: []string{
"timeout",
fmt.Sprintf("%d", mdsCmdTimeout),
"sh",
"-c",
mdsLivenessProbeCmd,
Expand Down
3 changes: 2 additions & 1 deletion pkg/operator/ceph/file/mds/livenessprobe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
MDS_ID="{{ .MdsId }}"
FILESYSTEM_NAME="{{ .FilesystemName }}"
KEYRING="{{ .Keyring }}"
CMD_TIMEOUT="{{ .CmdTimeout }}"

outp="$(ceph fs dump --mon-host="$ROOK_CEPH_MON_HOST" --mon-initial-members="$ROOK_CEPH_MON_INITIAL_MEMBERS" --keyring "$KEYRING" --format json)"
outp="$(ceph fs dump --mon-host="$ROOK_CEPH_MON_HOST" --mon-initial-members="$ROOK_CEPH_MON_INITIAL_MEMBERS" --keyring "$KEYRING" --connect-timeout="$CMD_TIMEOUT" --format json)"
rc=$?
if [ $rc -ne 0 ]; then
echo "ceph MDS dump check failed with the following output:"
Expand Down

0 comments on commit 5631896

Please sign in to comment.