Skip to content

✨ WIP Improved error handling around installedBundle and reconcile modularization - #1030

Closed
bentito wants to merge 15 commits into
operator-framework:mainfrom
bentito:improved-err-handling-installedbundle
Closed

✨ WIP Improved error handling around installedBundle and reconcile modularization#1030
bentito wants to merge 15 commits into
operator-framework:mainfrom
bentito:improved-err-handling-installedbundle

Conversation

@bentito

@bentitobentito commented Jul 10, 2024

Copy link
Copy Markdown
Contributor

Description

WIP, because:


  1. Improved Error Handling
  • State Preservation: The installedBundle information is fetched early on and preserved throughout the reconciliation process. Even if errors occur later, the status accurately reflects the previously installed bundle.

  • Partial Progress Reporting: Each step has its own error handling and status update logic. If an error occurs in one step, the status is updated accordingly (e.g., setResolvedStatusConditionFailed, setInstalledStatusConditionFailed), but the reconciliation process continues where possible. This ensures that partial progress is reported.

  • Progressing Status: The setInstalledStatusConditionProgressing function is used to indicate when a new version is resolved but not yet installed. The clearInstalledStatusConditionProgressing function is called when the installation is complete or if the resolved and installed bundles match.

  1. Modularization
  • Helper Functions: The reconcile function is broken down into smaller, self-contained helper functions (handleFinalization, resolveBundle, validateAndCheckDeprecation, unpackBundle, runPreflightChecks, installOrUpgrade, and watchDynamicResources). Each function handles a specific task, making the code more organized, readable, and testable.
  1. Helm Secret as Source of Truth
  • GetInstalledBundle: The InstalledBundleGetter.GetInstalledBundle function is used to retrieve the installed bundle information directly from the Helm secret, ensuring that the status accurately reflects the actual installed bundle.
  1. Comprehensive Status Updates
  • Status Updates at Each Step: Throughout the reconcile function and its helpers, status conditions are updated to reflect the progress and outcome of each step. This provides detailed information about the reconciliation process, even if errors occur.

  • Progressing Status: The TypeProgressing condition is used to clearly indicate when an installation or upgrade is in progress.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

bentito added 14 commits July 2, 2024 06:20
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Preserve installedBundle on error, report partial progress, use "Progressing" status.
Modularize into helper functions.
Use Helm secret as source of truth for installed bundle.
Update status at each step, clear "Progressing" on success/match.
Signed-off-by: Brett Tofel <btofel@redhat.com>
@bentitobentito added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
@bentito
bentito requested a review from a team as a code ownerJuly 10, 2024 14:54
@openshift-ciopenshift-ciBot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
@netlify

netlifyBot commented Jul 10, 2024

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit0469c53
🔍 Latest deploy loghttps://app.netlify.com/sites/olmv1/deploys/668ea3a86f0d370008b11e66
😎 Deploy Previewhttps://deploy-preview-1030--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@bentitobentito added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
Signed-off-by: Brett Tofel <btofel@redhat.com>
@openshift-ciopenshift-ciBot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 10, 2024
@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2024
@openshift-merge-robot

Copy link
Copy Markdown

PR needs rebase.

Details

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.

@tmshort

Copy link
Copy Markdown
Contributor

@bentito are you going to rebase this?

@bentito

Copy link
Copy Markdown
ContributorAuthor

@bentito are you going to rebase this?

I'm waiting to see about Bryce's refactoring from last week

@perdasilva

Copy link
Copy Markdown
Contributor

closing this as stale - please re-open if we still want to get this down =D

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebaseIndicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@bentito@openshift-merge-robot@tmshort@perdasilva