-
Notifications
You must be signed in to change notification settings - Fork 71
⚠️ WIP: ClusterExtensionRevision API Updates #2491
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/hold |
5a0ef97 to
6e4fa46
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2491 +/- ##
=======================================
Coverage 69.82% 69.82%
=======================================
Files 102 102
Lines 8496 8497 +1
=======================================
+ Hits 5932 5933 +1
Misses 2091 2091
Partials 473 473
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
pedjak
left a comment
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.
I would expect additional validation tests to add, given that we added a few more restrictions/checks in this PR. Like for checking min/max size of given arrays, etc.
| // | ||
| // Once set, even if empty, the phases field is immutable. | ||
| // | ||
| // Each phase in the list must have a unique name. The maximum number of phases is 20. |
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.
should we also set the min number of phases to 1?
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.
Sure, unless we can think of a genuinely useful reason to create a no-op CER? I can't think of one though.
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.
Update: Looks like we've intentionally built in the ability to have phases initially unset, and allow the normally immutable list to be updated once. If we want to preserve that, we can't set the minimum length to 1 with omitempty present. Removing omitempty removes our ability to leave it unset. Is it vital that we keep this in place?
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.
While we only use inline objects, it's ok to set a minimum. When we move to sharding, it could be that we'll want to create the ClusterExtensionRevision object first, then create the shards with the ownerref, then update the revision with the shard refs.
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.
Here's the helm chunked secret implementation: https://github.com/operator-framework/helm-operator-plugins/blob/f1e4eaf3b3924d3339dda2eee7f4520c47fd6162/pkg/storage/chunked.go#L62-L90
There we precompute everything, then:
- Create the immutable index object with all of the chunk references pre-filled
- Create the immutable chunks with owner refs to the index
We can do the same with the CER right?
- Make its phases fully immutable
- Generate the phase object contents and figure out what the names are going to be so we can pre-fill references in the CER
- Generate the CER with the phase object references pre-filled
- Generate the phase objects with the CER ownerRef
That way:
- If we try to read the phases from the CER after 3, but before 4, we correctly get an error instead of incorrectly assuming there are no phases
- If the CER is deleted between 3 and 4, we'll end up putting an ownerref on the phase objects that for an object that is already deleted and garbage collect will automatically delete the phase objects.
- Phases are immutable and create-only and we don't have to handle errors that could occur on an attempt to update the phases.
6e4fa46 to
1be387b
Compare
Fixing some missing flags and godoc comments brought up via API review. Signed-off-by: Daniel Franz <dfranz@redhat.com>
1be387b to
f417730
Compare
| // +listMapKey=name | ||
| // +optional | ||
| Phases []ClusterExtensionRevisionPhase `json:"phases,omitempty"` | ||
| InlinePhases []ClusterExtensionRevisionPhase `json:"inlinePhases,omitempty"` |
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.
what is purpose of prepending this field with Inline prefix?
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.
I did this as a result of @perdasilva 's comment here
let's also call .spec.phases something like .spec.inlinePhases and reserve phases for when we have the sharding done. This way we won't change the serialization in a breaking way later on.
Fixing some missing flags and godoc comments brought up via API review.
Reviewer Checklist