✨ Default Probes Refactor#2586
✨ Default Probes Refactor#2586openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Refactors how default progression probes are applied by moving the built-in/default probe set out of the ClusterExtensionRevision controller and into the applier-generated ClusterExtensionRevision spec, and extends the ProgressionProbes API with an observedGeneration gating option.
Changes:
- Add
observedGenerationtoProgressionProbe(API/types + applyconfigurations + CRD schemas) and wire it into probe building. - Generate/stamp default progression probes in the applier when constructing
ClusterExtensionRevisionobjects (and update unit expectations). - Update E2E feature specs to explicitly include progression probes when applying
ClusterExtensionRevisiondirectly.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/features/revision.feature | Adds explicit progressionProbes to CER YAML used in E2E scenarios. |
| manifests/experimental.yaml | Adds CRD schema for progressionProbes[].observedGeneration. |
| manifests/experimental-e2e.yaml | Same CRD schema update for E2E manifests. |
| helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml | Helm-packaged CRD schema updated with observedGeneration. |
| api/v1/clusterextensionrevision_types.go | Adds ObservedGeneration to ProgressionProbe and renames Go constants for probe type enums. |
| api/v1/zz_generated.deepcopy.go | Adds deepcopy support for ObservedGeneration *bool. |
| applyconfigurations/api/v1/progressionprobe.go | Adds ObservedGeneration field + WithObservedGeneration() builder. |
| internal/operator-controller/controllers/clusterextensionrevision_controller.go | Stops injecting controller-side default probes; builds observedGeneration-wrapped probes from CER spec. |
| internal/operator-controller/applier/boxcutter.go | Stamps default probes onto generated CER specs via defaultProgressionProbes(). |
| internal/operator-controller/applier/boxcutter_test.go | Updates expected generated CER spec to include default probes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Show resolved
Hide resolved
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Outdated
Show resolved
Hide resolved
94d5d71 to
8eb532b
Compare
8eb532b to
4457677
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2586 +/- ##
==========================================
+ Coverage 65.84% 68.44% +2.59%
==========================================
Files 137 137
Lines 9560 9593 +33
==========================================
+ Hits 6295 6566 +271
+ Misses 2795 2525 -270
- Partials 470 502 +32
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:
|
4457677 to
55b3524
Compare
| // +optional | ||
| // +kubebuilder:default:=false | ||
| // <opcon:experimental> | ||
| ObservedGeneration *bool `json:"observedGeneration,omitempty"` |
There was a problem hiding this comment.
I would not name it the same as .status.observedGeneration it is confusing. Also, not sure if we need pointer here, probably not.
Is there a case when this field needs to false?
There was a problem hiding this comment.
No, I don't really think so. If either field doesn't exist, the probe will just be executed directly. I'm personally fine with removing it and always wrapping the probes within.
There was a problem hiding this comment.
Removed the API field 👍 Let me know what you think!
55b3524 to
0af007d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/operator-controller/controllers/clusterextensionrevision_controller.go
Show resolved
Hide resolved
0af007d to
44ed914
Compare
44ed914 to
1756aaf
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pedjak
left a comment
There was a problem hiding this comment.
The description still says "adds flag to the API to allow checking status.observedGeneration==metadata.generation" but this API field was removed based on review feedback. Should be updated before merge.
| // Deprecated: use ProbeTypeConditionEqual instead. | ||
| ProbeTypeFieldCondition = ProbeTypeConditionEqual | ||
| // Deprecated: use ProbeTypeFieldsEqual instead. | ||
| ProbeTypeFieldEqual = ProbeTypeFieldsEqual |
There was a problem hiding this comment.
why is this needed, could not we replace things in code. Given that this API is still TP, I do not think we need to introduce any deprecation.
There was a problem hiding this comment.
This was recommended by copilot, +1ed by Camila. I'd also prefer not to have it, but then we'd have to deal with the api-diff check failing.
Removed
| }), | ||
| ), | ||
| )). | ||
| WithProgressionProbes( |
There was a problem hiding this comment.
The test duplicates the entire default probe set inline (~100 lines) rather than comparing against defaultProgressionProbes() directly. Any future change to defaults requires updating both the function and the test expectation in lockstep. Consider comparing against the function output or extracting the expected value.
1756aaf to
464075b
Compare
Migrates the default progression probes out of the CER controller into the boxcutter applier in order to use the ProgressionProbes API to transparently stamp out the checks. All probes will now check that status.observedGeneration==metadata.generation before executing probes, or execute them normally if objects do not contain those fields. Signed-off-by: Daniel Franz <dfranz@redhat.com>
464075b to
6562402
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, pedjak The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override go-apidiff |
|
@pedjak: Overrode contexts on behalf of pedjak: go-apidiff DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/override go-apidiff |
|
@camilamacedo86: /override requires failed status contexts, check run or a prowjob name to operate on.
Only the following failed contexts/checkruns were expected:
If you are trying to override a checkrun that has a space in it, you must put a double quote on the context. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/override go-apidiff |
|
@camilamacedo86: Overrode contexts on behalf of camilamacedo86: go-apidiff DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
789df82
into
operator-framework:main
Migrates the default progression probes out of the CER controller into the boxcutter applier in order to use the ProgressionProbes API to transparently stamp out the checks. All probes will now check that status.observedGeneration==metadata.generation before executing probes, or execute them normally if objects do not contain those fields.
Description
Reviewer Checklist