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

Merged
merged 1 commit into from
Nov 8, 2024

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.
@bolekk bolekk force-pushed the feature/KS-507-streams-deployment branch from 29ba2c1 to 939f9f6 Compare November 8, 2024 20:06
@bolekk bolekk added this pull request to the merge queue Nov 8, 2024
Merged via the queue into develop with commit 45db6b7 Nov 8, 2024
141 checks passed
@bolekk bolekk deleted the feature/KS-507-streams-deployment branch November 8, 2024 21:10
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.

3 participants