Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keystone][Deployments] Make adding NOPs and DONs idempotent #15163

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bolekk
Copy link
Contributor

@bolekk bolekk commented Nov 8, 2024

Similarly to adding capabilities or nodes, don't add NOPs or DONs that already exist.

@bolekk bolekk requested review from a team as code owners November 8, 2024 03:57
}
existingNopsAddrToID := make(map[string]uint32)
for id, nop := range existingNops {
existingNopsAddrToID[nop.Admin.String()] = uint32(id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the admin strings are phony in some of our deployments and not unique.

maybe hash the name,addr and use that as the key

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can just use the struct as the key

Copy link
Contributor

@krehermann krehermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

admin addr not unique in some existing contracts. this will change won't behave as expected; simplest fix is to hash the name and admin addr as map key.

there is nothing in the contract guaranteeing unique of admin addrs.

Copy link
Contributor

@krehermann krehermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meant to request change not approve

Similarly to adding capabilities or nodes, don't add NOPs or DONs that already exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants