Skip to content

Commit

Permalink
Merge pull request #9167 from parth-gr/mons-CRname
Browse files Browse the repository at this point in the history
mon: update mons Cluster ClusterInfo with CR name
  • Loading branch information
travisn committed Nov 15, 2021
2 parents 2a5cbe9 + 242f98e commit 54a2b56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/operator/ceph/cluster/mon/mon.go
Expand Up @@ -208,7 +208,7 @@ func (c *Cluster) Start(clusterInfo *cephclient.ClusterInfo, rookVersion string,
logger.Infof("start running mons")

logger.Debugf("establishing ceph cluster info")
if err := c.initClusterInfo(cephVersion); err != nil {
if err := c.initClusterInfo(cephVersion, c.ClusterInfo.NamespacedName().Name); err != nil {
return nil, errors.Wrap(err, "failed to initialize ceph cluster info")
}

Expand Down Expand Up @@ -477,7 +477,7 @@ func (c *Cluster) ensureMonsRunning(mons []*monConfig, i, targetCount int, requi

// initClusterInfo retrieves the ceph cluster info if it already exists.
// If a new cluster, create new keys.
func (c *Cluster) initClusterInfo(cephVersion cephver.CephVersion) error {
func (c *Cluster) initClusterInfo(cephVersion cephver.CephVersion, clusterName string) error {
var err error

context := c.ClusterInfo.Context
Expand All @@ -490,6 +490,7 @@ func (c *Cluster) initClusterInfo(cephVersion cephver.CephVersion) error {
c.ClusterInfo.CephVersion = cephVersion
c.ClusterInfo.OwnerInfo = c.ownerInfo
c.ClusterInfo.Context = context
c.ClusterInfo.SetName(clusterName)

// save cluster monitor config
if err = c.saveMonConfig(); err != nil {
Expand Down

0 comments on commit 54a2b56

Please sign in to comment.