Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0fcf963d6 | |||
| 54effed139 | |||
| 89b32177b2 | |||
| a9399c8abf | |||
| 8f36f98da9 | |||
| e0e2def833 | |||
| bfcd9f26be |
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"cSpell.words": [
|
||||
"ceph",
|
||||
"darvaza",
|
||||
"jpictl",
|
||||
"zerolog"
|
||||
]
|
||||
}
|
||||
@@ -4,21 +4,9 @@ import (
|
||||
"bytes"
|
||||
"sort"
|
||||
|
||||
"darvaza.org/core"
|
||||
"github.com/gofrs/uuid/v5"
|
||||
|
||||
"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
|
||||
func (m *Zones) GetCephConfig() (*ceph.Config, error) {
|
||||
data, err := m.ReadFile("ceph.conf")
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
"sort"
|
||||
|
||||
"darvaza.org/resolver"
|
||||
"github.com/gofrs/uuid/v5"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -136,21 +135,15 @@ func (z *Zone) GatewayIDs() ([]int, int) {
|
||||
return out, len(out)
|
||||
}
|
||||
|
||||
// revive:disable:line-length-limit
|
||||
|
||||
// Zones represents all zones in a cluster
|
||||
type Zones struct {
|
||||
dir fs.FS
|
||||
resolver resolver.Resolver
|
||||
domain string
|
||||
|
||||
CephFSID uuid.UUID `toml:"ceph_fsid,omitempty" json:"ceph_fsid,omitempty" yaml:"ceph_fsid,omitempty"`
|
||||
|
||||
Zones []*Zone `toml:"zones"`
|
||||
}
|
||||
|
||||
// revive:enable:line-length-limit
|
||||
|
||||
// ForEachMachine calls a function for each Machine in the cluster
|
||||
// until instructed to terminate the loop
|
||||
func (m *Zones) ForEachMachine(fn func(*Machine) bool) {
|
||||
|
||||
Reference in New Issue
Block a user