Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a one-time cleanup task for role mapping duplicates both in cluster state and the
.security
index. The cleanup task is triggered once, the first time thesettings.json
is reloaded after this PR has been deployed. The task compares the names of the role mappings in the operator-definedsettings.json
and the names of the role mappings in the.security
index and removes or disables (TBD which one) the one in the .security index. It also adds the name field to the serialization of the role mapping, since the name is needed for the GET Role Mappings API.Issue
This cleanup is done because there was a bug (fixed here) that caused ECK customers to have the same role mappings with the same names present both in cluster state and the
.security
index. The effective role mapping is the combination of the.security
index mapping and the cluster state one. After the bug fix, if the mapping in cluster state is modified (throughsetting.json
), the.security
index will still contain the old mapping and this could lead to unintended behaviour.Open Questions
settings.json
) is re-loaded on every master node restart (draft PR )enabled: false
) which could be confusing since they're not active during role mapping in the auth/authz flow. Deleting them means users can't recover if the cleanup does something wrong.Risks
.security
index and the cluster state and will be removed by this PR (minimal since before 8.15 it wasn't possible to this).security
index to workaround the bug fixed here will be removed and all changes might not be reflected in thesettings.json
role mappings (Only reported by a few customers)Dependencies
TODO