Skip to content

Commit

Permalink
Merge pull request #402 from aerospike/v7.6.0
Browse files Browse the repository at this point in the history
V7.6.0
  • Loading branch information
robertglonek authored Sep 4, 2024
2 parents e3aa5f3 + d4f7fa0 commit f957411
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/cmdAgi.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,11 @@ func (c *agiRetriggerCmd) Execute(args []string) error {

// marshal new config
var encBuf bytes.Buffer
var encBufPretty bytes.Buffer
enc := yaml.NewEncoder(&encBuf)
enc.SetIndent(2)
encPretty := yaml.NewEncoder(&encBufPretty)
encPretty.SetIndent(2)
s3secret := conf.Downloader.S3Source.SecretKey
sftpSecret := conf.Downloader.SftpSource.Password
keySecret := conf.Downloader.SftpSource.KeyFile
Expand All @@ -505,17 +508,22 @@ func (c *agiRetriggerCmd) Execute(args []string) error {
if conf.Downloader.SftpSource.KeyFile != "" {
conf.Downloader.SftpSource.KeyFile = "<redacted>"
}
err = enc.Encode(conf)
err = encPretty.Encode(conf)
conf.Downloader.S3Source.SecretKey = s3secret
conf.Downloader.SftpSource.Password = sftpSecret
conf.Downloader.SftpSource.KeyFile = keySecret
if err != nil {
return fmt.Errorf("could not marshal new config to yaml: %s", err)
}
err = enc.Encode(conf)
if err != nil {
return fmt.Errorf("could not marshal new config to yaml: %s", err)
}
newConfigPretty := encBufPretty.Bytes()
newConfig := encBuf.Bytes()

// diff old and new config and show diff, ask if sure to continue
fmt.Println(string(diff.Diff("old", []byte(oldConfig), "new", newConfig)))
fmt.Println(string(diff.Diff("old", []byte(oldConfig), "new", newConfigPretty)))
if !c.Force {
for {
reader := bufio.NewReader(os.Stdin)
Expand Down
2 changes: 1 addition & 1 deletion src/cmdAgiCreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ func (c *agiCreateCmd) Execute(args []string) error {
if a.opts.Config.Backend.Type == "docker" {
installScript = fmt.Sprintf(agiCreateScriptDocker, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, wbs, c.ClusterName, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml)
} else {
shutdownCmd := "/sbin/poweroff -p || /sbin/poweroff"
shutdownCmd := "/usr/bin/systemctl stop aerospike; /usr/bin/sync; /sbin/poweroff -p || /sbin/poweroff"
installScript = fmt.Sprintf(agiCreateScript, override, c.NoDIM, c.Owner, edition, edition, cedition, toolsUpgrade, memSizeStr, storEngine, fileSizeInt, dimStr, rpcStr, wbs, maxWriteCache, c.ClusterName, shutdownCmd, c.ClusterName, c.AGILabel, proxyPort, proxySSL, proxyCert, proxyKey, proxyMaxInactive, proxyMaxUptime, maxDp, c.PluginLogLevel, cpuProfiling, notifierYaml)
}
flist = append(flist, fileListReader{filePath: "/root/agiinstaller.sh", fileContents: strings.NewReader(installScript), fileSize: len(installScript)})
Expand Down

0 comments on commit f957411

Please sign in to comment.