Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2279c1cd88 | |||
| 781beef410 | |||
| 6e8fd3ed38 | |||
| 80afc24ca8 | |||
| 3820fd84f2 | |||
| 781277980c | |||
| 44d6ad2599 | |||
| 9d3a9627e3 | |||
| 655dacac42 | |||
| ff4bb97599 |
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"ceph",
|
||||||
|
"darvaza",
|
||||||
|
"jpictl",
|
||||||
|
"zerolog"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -4,9 +4,21 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
|
"darvaza.org/core"
|
||||||
|
"github.com/gofrs/uuid/v5"
|
||||||
|
|
||||||
"git.jpi.io/amery/jpictl/pkg/ceph"
|
"git.jpi.io/amery/jpictl/pkg/ceph"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// GetCephFSID returns our Ceph's FSID
|
||||||
|
func (m *Zones) GetCephFSID() (uuid.UUID, error) {
|
||||||
|
if core.IsZero(m.CephFSID) {
|
||||||
|
// TODO: generate one
|
||||||
|
return uuid.Nil, nil
|
||||||
|
}
|
||||||
|
return m.CephFSID, nil
|
||||||
|
}
|
||||||
|
|
||||||
// GetCephConfig reads the ceph.conf file
|
// GetCephConfig reads the ceph.conf file
|
||||||
func (m *Zones) GetCephConfig() (*ceph.Config, error) {
|
func (m *Zones) GetCephConfig() (*ceph.Config, error) {
|
||||||
data, err := m.ReadFile("ceph.conf")
|
data, err := m.ReadFile("ceph.conf")
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"darvaza.org/resolver"
|
"darvaza.org/resolver"
|
||||||
|
"github.com/gofrs/uuid/v5"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -135,15 +136,21 @@ func (z *Zone) GatewayIDs() ([]int, int) {
|
|||||||
return out, len(out)
|
return out, len(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// revive:disable:line-length-limit
|
||||||
|
|
||||||
// Zones represents all zones in a cluster
|
// Zones represents all zones in a cluster
|
||||||
type Zones struct {
|
type Zones struct {
|
||||||
dir fs.FS
|
dir fs.FS
|
||||||
resolver resolver.Resolver
|
resolver resolver.Resolver
|
||||||
domain string
|
domain string
|
||||||
|
|
||||||
|
CephFSID uuid.UUID `toml:"ceph_fsid,omitempty" json:"ceph_fsid,omitempty" yaml:"ceph_fsid,omitempty"`
|
||||||
|
|
||||||
Zones []*Zone `toml:"zones"`
|
Zones []*Zone `toml:"zones"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// revive:enable:line-length-limit
|
||||||
|
|
||||||
// ForEachMachine calls a function for each Machine in the cluster
|
// ForEachMachine calls a function for each Machine in the cluster
|
||||||
// until instructed to terminate the loop
|
// until instructed to terminate the loop
|
||||||
func (m *Zones) ForEachMachine(fn func(*Machine) bool) {
|
func (m *Zones) ForEachMachine(fn func(*Machine) bool) {
|
||||||
|
|||||||
Reference in New Issue
Block a user