Skip to content

Commit

Permalink
Merge pull request #552 from sp98/fix-osd-migration-4.15
Browse files Browse the repository at this point in the history
Bug 2241268: osd: create config before migration osd
  • Loading branch information
travisn authored Jan 8, 2024
2 parents fff70f4 + 29c3b1c commit edab3a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cmd/rook/ceph/osd.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/pkg/errors"
"github.com/rook/rook/cmd/rook/rook"
cephv1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
"github.com/rook/rook/pkg/daemon/ceph/client"
osddaemon "github.com/rook/rook/pkg/daemon/ceph/osd"
"github.com/rook/rook/pkg/operator/ceph/cluster/mon"
oposd "github.com/rook/rook/pkg/operator/ceph/cluster/osd"
Expand Down Expand Up @@ -255,6 +256,10 @@ func prepareOSD(cmd *cobra.Command, args []string) error {
clusterInfo.Context = cmd.Context()
kv := k8sutil.NewConfigMapKVStore(clusterInfo.Namespace, context.Clientset, ownerInfo)

if err := client.WriteCephConfig(context, &clusterInfo); err != nil {
return errors.Wrap(err, "failed to generate ceph config")
}

// destroy the OSD using the OSD ID
var replaceOSD *oposd.OSDReplaceInfo
if replaceOSDID != -1 {
Expand Down
4 changes: 0 additions & 4 deletions pkg/daemon/ceph/osd/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ func Provision(context *clusterd.Context, agent *OsdAgent, crushLocation, topolo
status := oposd.OrchestrationStatus{Status: oposd.OrchestrationStatusOrchestrating}
oposd.UpdateNodeOrPVCStatus(agent.clusterInfo.Context, agent.kv, agent.nodeName, status)

if err := client.WriteCephConfig(context, agent.clusterInfo); err != nil {
return errors.Wrap(err, "failed to generate ceph config")
}

logger.Infof("discovering hardware")

var rawDevices []*sys.LocalDisk
Expand Down

0 comments on commit edab3a1

Please sign in to comment.