Skip to content

Commit

Permalink
Merge pull request #376 from aerospike/v7.6.0
Browse files Browse the repository at this point in the history
V7.6.0
  • Loading branch information
robertglonek authored Jul 30, 2024
2 parents bfb5159 + e36a59b commit c3ec34b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
24 changes: 24 additions & 0 deletions src/backendAwsKeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ func (d *backendAws) GetKeyPath(clusterName string) (keyPath string, err error)
}

func (d *backendAws) getKeyPathNoCheck(clusterName string) (keyPath string) {
homeDir, err := a.aerolabRootDir()
if err == nil {
if _, err := os.Stat(path.Join(homeDir, "sshkey")); err == nil {
return path.Join(homeDir, "sshkey")
}
}
keyName := fmt.Sprintf("aerolab-%s_%s", clusterName, a.opts.Config.Backend.Region)
keyPath = path.Join(string(a.opts.Config.Backend.SshKeyPath), keyName)
if _, err := os.Stat(keyPath); os.IsNotExist(err) {
Expand All @@ -25,6 +31,12 @@ func (d *backendAws) getKeyPathNoCheck(clusterName string) (keyPath string) {

// get KeyPair
func (d *backendAws) getKey(clusterName string) (keyName string, keyPath string, err error) {
homeDir, err := a.aerolabRootDir()
if err == nil {
if _, err := os.Stat(path.Join(homeDir, "sshkey")); err == nil {
return "manual-aerolab-agi-shared", path.Join(homeDir, "sshkey"), nil
}
}
keyName = fmt.Sprintf("aerolab-%s_%s", clusterName, a.opts.Config.Backend.Region)
keyPath = path.Join(string(a.opts.Config.Backend.SshKeyPath), keyName)
// check keyName exists, if not, error
Expand All @@ -47,6 +59,12 @@ func (d *backendAws) getKey(clusterName string) (keyName string, keyPath string,

// get KeyPair
func (d *backendAws) makeKey(clusterName string) (keyName string, keyPath string, err error) {
homeDir, err := a.aerolabRootDir()
if err == nil {
if _, err := os.Stat(path.Join(homeDir, "sshkey")); err == nil {
return "manual-aerolab-agi-shared", path.Join(homeDir, "sshkey"), nil
}
}
keyName = fmt.Sprintf("aerolab-%s_%s", clusterName, a.opts.Config.Backend.Region)
keyPath = path.Join(string(a.opts.Config.Backend.SshKeyPath), keyName)
_, _, err = d.getKey(clusterName)
Expand Down Expand Up @@ -74,6 +92,12 @@ func (d *backendAws) makeKey(clusterName string) (keyName string, keyPath string

// get KeyPair
func (d *backendAws) killKey(clusterName string) (keyName string, keyPath string, err error) {
homeDir, err := a.aerolabRootDir()
if err == nil {
if _, err := os.Stat(path.Join(homeDir, "sshkey")); err == nil {
return "manual-aerolab-agi-shared", path.Join(homeDir, "sshkey"), nil
}
}
keyName = fmt.Sprintf("aerolab-%s_%s", clusterName, a.opts.Config.Backend.Region)
keyPath = path.Join(string(a.opts.Config.Backend.SshKeyPath), keyName)
os.Remove(keyPath)
Expand Down
8 changes: 4 additions & 4 deletions web/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ function initDatatable() {
{
className: 'btn btn-warning dtTooltip',
titleAttr: 'Open form: Extend node(s) expiry time',
text: 'Extend Expiry',
text: 'Change Expiry',
action: function ( e, dt, node, config ) {
let arr = [];
dt.rows({selected: true}).every(function(rowIdx, tableLoop, rowLoop) {arr.push(this.data());});
Expand Down Expand Up @@ -1135,8 +1135,8 @@ function initDatatable() {
{extend: 'myspacer'},
{
className: 'btn btn-warning dtTooltip',
titleAttr: 'Go to form: extend expiry of instance(s)',
text: 'Extend Expiry',
titleAttr: 'Go to form: Change Expiry of instance(s)',
text: 'Change Expiry',
action: function ( e, dt, node, config ) {
let arr = [];
dt.rows({selected: true}).every(function(rowIdx, tableLoop, rowLoop) {arr.push(this.data());});
Expand Down Expand Up @@ -1276,7 +1276,7 @@ function initDatatable() {
{
className: 'btn btn-warning dtTooltip',
titleAttr: 'Open form: Extend node(s) expiry time',
text: 'Extend Expiry',
text: 'Change Expiry',
action: function ( e, dt, node, config ) {
let arr = [];
dt.rows({selected: true}).every(function(rowIdx, tableLoop, rowLoop) {arr.push(this.data());});
Expand Down

0 comments on commit c3ec34b

Please sign in to comment.