ceph: add initial ceph support. reading and writing m/ceph.conf #9

Merged
amery merged 13 commits from pr-amery-ceph into main 2023-09-05 21:35:53 +02:00
Showing only changes of commit 05e04c758b - Show all commits
+15
View File
@@ -1,8 +1,12 @@
package zones
import (
"bytes"
"darvaza.org/core"
"github.com/gofrs/uuid/v5"
"git.jpi.io/amery/jpictl/pkg/ceph"
)
// GetCephFSID returns our Ceph's FSID
@@ -13,3 +17,14 @@ func (m *Zones) GetCephFSID() (uuid.UUID, error) {
}
return m.CephFSID, nil
}
// GetCephConfig reads the ceph.conf file
func (m *Zones) GetCephConfig() (*ceph.Config, error) {
data, err := m.ReadFile("ceph.conf")
if err != nil {
return nil, err
}
r := bytes.NewReader(data)
return ceph.NewConfigFromReader(r)
}