mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
e2e: introduce getClusterID() helper
There are many locations where the cluster-id (`ceph fsid`) is obtained from the Rook Toolbox. Instead of duplicating the code everywhere, use a new helper function getClusterID(). Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
b20e3fa784
commit
e30364cb4d
@ -20,7 +20,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/ceph/ceph-csi/internal/util"
|
||||
|
||||
@ -45,15 +44,11 @@ func createConfigMap(pluginPath string, c kubernetes.Interface, f *framework.Fra
|
||||
return err
|
||||
}
|
||||
|
||||
fsID, stdErr, err := execCommandInToolBoxPod(f, "ceph fsid", rookNamespace)
|
||||
fsID, err := getClusterID(f)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to exec command in toolbox: %w", err)
|
||||
return fmt.Errorf("failed to get clusterID: %w", err)
|
||||
}
|
||||
if stdErr != "" {
|
||||
return fmt.Errorf("error getting fsid %v", stdErr)
|
||||
}
|
||||
// remove new line present in fsID
|
||||
fsID = strings.Trim(fsID, "\n")
|
||||
|
||||
// get mon list
|
||||
mons, err := getMons(rookNamespace, c)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user