Skip to content

Commit

Permalink
cephfs: upgrading mount syntax
Browse files Browse the repository at this point in the history
Getting FsID instead of ClusterID as parameter
  • Loading branch information
MageekChiu committed Jan 25, 2025
1 parent 21d1d64 commit 63c4692
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cephfs/mounter/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (m *kernelMounter) mountKernel(

args := []string{
"-t", "ceph",
fmt.Sprintf("%s@%s.%s=%s", cr.ID, volOptions.ClusterID, volOptions.FsName, volOptions.RootPath),
fmt.Sprintf("%s@%s.%s=%s", cr.ID, volOptions.FsID, volOptions.FsName, volOptions.RootPath),
mountPoint,
}

Expand Down
16 changes: 16 additions & 0 deletions internal/cephfs/store/volumeoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type VolumeOptions struct {
RequestName string
NamePrefix string
ClusterID string
FsID string
MetadataPool string
// ReservedID represents the ID reserved for a subvolume
ReservedID string
Expand Down Expand Up @@ -318,6 +319,11 @@ func NewVolumeOptions(
return nil, err
}

opts.FsID, err = opts.conn.GetFSID()
if err != nil {
return nil, err
}

opts.MetadataPool, err = fs.GetMetadataPool(ctx, opts.FsName)
if err != nil {
return nil, err
Expand Down Expand Up @@ -442,6 +448,11 @@ func NewVolumeOptionsFromVolID(
return nil, nil, err
}

volOptions.FsID, err = volOptions.conn.GetFSID()
if err != nil {
return nil, nil, err
}

volOptions.MetadataPool, err = fs.GetMetadataPool(ctx, volOptions.FsName)
if err != nil {
return nil, nil, err
Expand Down Expand Up @@ -826,6 +837,11 @@ func NewSnapshotOptionsFromID(
return &volOptions, nil, &sid, err
}

volOptions.FsID, err = volOptions.conn.GetFSID()
if err != nil {
return &volOptions, nil, &sid, err
}

volOptions.MetadataPool, err = fs.GetMetadataPool(ctx, volOptions.FsName)
if err != nil {
return &volOptions, nil, &sid, err
Expand Down

0 comments on commit 63c4692

Please sign in to comment.