service: do not show pebble as an option on unsupported architectures

This commit is contained in:
Hector Sanjuan 2023-03-03 16:53:06 +01:00
parent 615162b739
commit 7c32a117f1
4 changed files with 18 additions and 3 deletions

View File

@ -37,7 +37,6 @@ const programName = "ipfs-cluster-service"
const (
defaultLogLevel = "info"
defaultConsensus = "crdt"
defaultDatastore = "badger"
)
const (
@ -274,7 +273,7 @@ the peer IDs in the given multiaddresses.
},
cli.StringFlag{
Name: "datastore",
Usage: "select datastore: 'badger', 'badger3', 'leveldb', 'pebble'",
Usage: datastoreFlagUsage,
Value: defaultDatastore,
},
cli.BoolFlag{

View File

@ -0,0 +1,8 @@
//go:build arm || 386 || (openbsd && amd64)
package main
const (
defaultDatastore = "badger"
datastoreFlagUsage = "select datastore: 'badger', 'badger3' or 'leveldb'"
)

View File

@ -0,0 +1,8 @@
//go:build !arm && !386 && !(openbsd && amd64)
package main
const (
defaultDatastore = "badger"
datastoreFlagUsage = "select datastore: 'badger', 'badger3', 'leveldb' or 'pebble'"
)

View File

@ -51,7 +51,7 @@ func (cfg *Config) LoadJSON(raw []byte) error {
// ToJSON generates a JSON-formatted human-friendly representation of this
// Config.
func (cfg *Config) ToJSON() (raw []byte, err error) {
return []byte("{}"), nil
return []byte("{}"), ErrUnsupported
}
// GetFolder returns the Pebble folder.