adm: Take network settings into account during netmap contract update #234

Merged
fyrchik merged 3 commits from acid-ant/frostfs-node:bugfix/100-adm-updt-contract into master 2023-04-14 05:12:51 +00:00
Member

Close #100

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Close #100 Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant requested review from storage-core-committers 2023-04-11 08:32:11 +00:00
acid-ant requested review from storage-core-developers 2023-04-11 08:32:12 +00:00
dstepanov-yadro reviewed 2023-04-11 10:29:54 +00:00
@ -582,0 +575,4 @@
if method == updateMethodName {
arr, err := c.getNetConfigFromNetmapContract()
if err != nil {
panic(err)

Do we really need panic? Maybe return error?

Do we really need panic? Maybe return error?
Author
Member

Used panic here because don't want to change method signature and this approach was used before in this method.

Used panic here because don't want to change method signature and this approach was used before in this method.
dstepanov-yadro marked this conversation as resolved
fyrchik approved these changes 2023-04-11 11:18:44 +00:00
CHANGELOG.md Outdated
@ -75,3 +76,3 @@
more appropriate for a specific deployment.
Use `__SYSTEM__` prefix for system attributes instead of `__NEOFS__`
Use `__SYSTEM__` prefix for system attributes instead of `__NEOFS__`
Owner

Unrelated to the commit.

Unrelated to the commit.
Author
Member

Moved to another commit.

Moved to another commit.
fyrchik marked this conversation as resolved
@ -582,0 +582,4 @@
panic(err)
}
for k, v := range m {
if slices.Contains(netmapConfigKeys, k) {
Owner

Do we really need this dependency? >_<

Do we really need this dependency? >_<
Owner

I mean we could use it, but let's create a task to use it across the whole repo, I think there are other places which could benefit.

I mean we could use it, but let's create a task to use it across the whole repo, I think there are other places which could benefit.
Author
Member

Replaced slice with map.

Replaced slice with map.
dstepanov-yadro approved these changes 2023-04-11 11:54:06 +00:00
acid-ant force-pushed bugfix/100-adm-updt-contract from 4d23ac4d7d to 4d19cdc851 2023-04-11 11:59:58 +00:00 Compare
acid-ant force-pushed bugfix/100-adm-updt-contract from 4d19cdc851 to 49f712e0b6 2023-04-11 12:05:49 +00:00 Compare
acid-ant requested review from fyrchik 2023-04-11 12:08:40 +00:00
aarifullin approved these changes 2023-04-11 15:22:13 +00:00
acid-ant force-pushed bugfix/100-adm-updt-contract from 49f712e0b6 to 850d304a10 2023-04-12 08:52:06 +00:00 Compare
fyrchik reviewed 2023-04-12 18:25:02 +00:00
@ -86,2 +75,4 @@
alphabetContract,
}, contractList...)
netmapConfigKeys = map[string]any{
Owner

We use it only in 1 place, can we just iterate over a slice?

We use it only in 1 place, can we just iterate over a slice?
Author
Member

Done, please review.

Done, please review.
fyrchik marked this conversation as resolved
@ -582,0 +574,4 @@
if method == updateMethodName {
arr, err := c.getNetConfigFromNetmapContract()
if err != nil {
panic(err)
Owner

Why do we panic here?

Why do we panic here?
Author
Member

Used panic here because don't want to change method signature and this approach was used before in this method.

Used panic here because don't want to change method signature and this approach was used before in this method.
acid-ant force-pushed bugfix/100-adm-updt-contract from 850d304a10 to 9be5652b41 2023-04-13 14:45:17 +00:00 Compare
fyrchik approved these changes 2023-04-14 05:12:40 +00:00
fyrchik merged commit 299b6a6938 into master 2023-04-14 05:12:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#234
No description provided.