-
Notifications
You must be signed in to change notification settings - Fork 254
pkg/configmap: sort configmap data by key when loading bundle #1630
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
pkg/configmap: sort configmap data by key when loading bundle #1630
Conversation
This functionality is used by OLMv0 to construct an `api.Bundle` object that is needed to create install plan steps, which are eventually put into the installplan.status.plan field. It is important to have deterministic ordering of slice fields in Kubernetes APIs to avoid constant re-reconciliation and/or false positive change detection. Specifically in the case of InstallPlan steps, the order of the steps does have _some_ semantic requirements (CSV, then CRDs, then everything else). The problem is that if "everything else" is in a random order, the order of the resulting steps will still have non-determinism. If we have deterministic order of steps, OLM may be able to resolve a class of bugs related to unnecessary creation of multiple install plans that would otherwise be identical. Signed-off-by: Joe Lanford <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1630 +/- ##
=======================================
Coverage 46.79% 46.79%
=======================================
Files 135 135
Lines 15887 15888 +1
=======================================
+ Hits 7434 7435 +1
Misses 7412 7412
Partials 1041 1041 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
While I don't see any harms on sorting items in configmap data using their names, ultimately I don't see the point of doing so. The order that actually matters is the order of steps in InstallPlan. While steps are being installed, at each step, OLM simply looks up the correlative item in the configmap. So changing the order in configmap has no impact on anything. If there is, you need to add a test case to show the correlation between InstallPlan steps and Configmap items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, joelanford The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e80f892
into
operator-framework:master
Description of the change:
Sort configmap data by key when loading bundle (which is derived from filenames in the bundle directories)
Motivation for the change:
This functionality is used by OLMv0 to construct an
api.Bundle
object that is needed to create install plan steps, which are eventually put into the installplan.status.plan field. It is important to have deterministic ordering of slice fields in Kubernetes APIs to avoid constant re-reconciliation and/or false positive change detection.Specifically in the case of InstallPlan steps, the order of the steps does have some semantic requirements (CSV, then CRDs, then everything else). The problem is that if "everything else" is in a random order, the order of the resulting steps will still have non-determinism.
If we have deterministic order of steps, OLM may be able to resolve a class of bugs related to unnecessary creation of multiple install plans that would otherwise be identical.
Reviewer Checklist
/docs