Skip to content

Commit

Permalink
Add custom config file path option to cluster partition conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Glonek committed Feb 26, 2025
1 parent aaa2438 commit a4b42c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG/7.8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ _Release Date: MONTH DAYst, 2025_
* AGI: The `aerolab agi create` and `aerolab agi run-ingest` commands now support specifying `--source-cluster` to quickly AGI an existing AeroLab cluster.
* AGI: Add aerospike `v8` patterns for graphing `MRTs`.
* AGI: Add hidden option `--send-cluster-info` to ship basic cluster information on discovery to a 3rd-party destination.
* Fix `arm64` support in `client vscode`.
* Fix `arm64` support in `client vscode`.
* Add custom config file path option to `cluster partition conf`.
9 changes: 5 additions & 4 deletions src/cmdClusterPartitionConf.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type clusterPartitionConfCmd struct {
Namespace string `short:"m" long:"namespace" description:"namespace to modify the settings for" default:""`
ConfDest string `short:"o" long:"configure" description:"what to configure the selections as; options: memory|device|shadow|pi-flash|si-flash" default:""`
MountsSizeLimitPct float64 `short:"s" long:"mounts-size-limit-pct" description:"specify %% space to use for configurating partition-tree-sprigs for pi-flash; this also sets mounts-budget accordingly" default:"90"`
ConfigPath string `short:"c" long:"config-path" description:"path to a custom aerospike config file to use for the configuration" default:"/etc/aerospike/aerospike.conf"`
parallelThreadsLongCmd
Help helpCmd `command:"help" subcommands-optional:"true" description:"Print help"`
}
Expand Down Expand Up @@ -129,14 +130,14 @@ func (c *clusterPartitionConfCmd) do(nodeNo int, disks map[int]map[int]blockDevi
}
}

outn, err = b.RunCommands(c.ClusterName.String(), [][]string{{"cat", "/etc/aerospike/aerospike.conf"}}, []int{nodeNo})
outn, err = b.RunCommands(c.ClusterName.String(), [][]string{{"cat", c.ConfigPath}}, []int{nodeNo})
if err != nil {
return fmt.Errorf("could not read aerospike.conf on node %d: %s", nodeNo, err)
return fmt.Errorf("could not read %s on node %d: %s", c.ConfigPath, nodeNo, err)
}
aconf := outn[0]
conf, err := aeroconf.Parse(bytes.NewReader(aconf))
if err != nil {
return fmt.Errorf("could not parse aerospike.conf on node %d: %s", nodeNo, err)
return fmt.Errorf("could not parse %s on node %d: %s", c.ConfigPath, nodeNo, err)
}

if conf.Type("namespace "+c.Namespace) == aeroconf.ValueNil {
Expand Down Expand Up @@ -344,7 +345,7 @@ func (c *clusterPartitionConfCmd) do(nodeNo int, disks map[int]map[int]blockDevi
return err
}
aconf = buf.Bytes()
err = b.CopyFilesToCluster(c.ClusterName.String(), []fileList{{"/etc/aerospike/aerospike.conf", string(aconf), len(aconf)}}, []int{nodeNo})
err = b.CopyFilesToCluster(c.ClusterName.String(), []fileList{{c.ConfigPath, string(aconf), len(aconf)}}, []int{nodeNo})
if err != nil {
return err
}
Expand Down

0 comments on commit a4b42c9

Please sign in to comment.