Skip to content

Commit

Permalink
Merge pull request #2148 from gravitl/GRA-1459-extclient
Browse files Browse the repository at this point in the history
Gra 1459 extclient
  • Loading branch information
afeiszli authored Mar 29, 2023
2 parents d41a105 + 72ff3fe commit cdf0738
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions logic/extpeers.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,23 @@ func UpdateExtClient(newclientid string, network string, enabled bool, client *m
if err != nil {
return client, err
}
if newclientid != client.ClientID {
//name change only
client.ClientID = newclientid
client.LastModified = time.Now().Unix()
data, err := json.Marshal(&client)
if err != nil {
return nil, err
}
key, err := GetRecordKey(client.ClientID, client.Network)
if err != nil {
return nil, err
}
if err = database.Insert(key, string(data), database.EXT_CLIENT_TABLE_NAME); err != nil {
return client, err
}
return client, nil
}
client.ClientID = newclientid
client.Enabled = enabled
SetClientACLs(client, newACLs)
Expand Down

0 comments on commit cdf0738

Please sign in to comment.