Run the upgrade preflight from a chart pre-upgrade hook - #98
Open
recharte wants to merge 3 commits into
Open
Conversation
Wire the provider-runtime preflight into the chart: a pre-upgrade hook Job runs the new provider image with --preflight-spec against the target catalog (a ConfigMap rendered from the same generated provider-spec.yaml the release applies) and the live Instances, aborting the upgrade before anything is applied when a blocking issue is found. Hook resources are ephemeral with read-only RBAC; the hook never runs on install. The Job also exposes TARGET_OPERATOR_VERSION (the bundled operator subchart version) for provider-specific upgrade checks. Regenerating with the current provider-sdk adds release.version (from the chart appVersion) to the generated provider spec, which the preflight uses to report the upgrade path. Signed-off-by: Diogo Recharte <diogo.recharte@solanica.io>
This was referenced Sep 3, 2026
The hook pod now honors imagePullSecrets (it is by design the first pull of the new image), podSecurityContext/securityContext and resources (PSS-restricted and quota'd namespaces), and nodeSelector/affinity/tolerations (tainted clusters), mirroring the main deployment. activeDeadlineSeconds bounds unschedulable pods to a deterministic failure instead of the Helm timeout. The operator-version env is derived from the same subchart value as the deployment, and the hook ConfigMap carries the Service's selector labels. Preflight infra errors now reach the preserved pod log via stderr (the controller-runtime logger is not initialized on that path), and CI asserts the rendered hook contract. Signed-off-by: Diogo Recharte <diogo.recharte@solanica.io>
recharte
force-pushed
the
feat/upgrade-preflight-hook
branch
from
September 3, 2026 15:44
d9d0adf to
8356b00
Compare
helm dependency build resolves the psmdb-operator subchart from percona.github.io, which the runner has no repo definition for. Signed-off-by: Diogo Recharte <diogo.recharte@solanica.io>
recharte
marked this pull request as ready for review
September 3, 2026 22:26
chilagrow
approved these changes
Sep 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Completes Part 1 of the provider upgrades feature for PSMDB (spec 009 §6.3): the compatibility/upgrade-path preflight now actually gates
helm upgrade.--preflight-specmode in the provider binary: runsprovider-runtime/preflight.Runagainst the target Provider spec and exits non-zero on any blocking issue (openeverest#3069).templates/preflight-hook.yaml: pre-upgrade hook resources — a ConfigMap carrying the target catalog (rendered from the samegenerated/provider-spec.yamlthis release applies, so the catalog has one source of truth), ephemeral read-only RBAC (providers/instances + psmdb CRs for provider-specific checks), and a Job running the new provider image in preflight mode. A non-zero exit aborts the upgrade before any resource is applied; the hook never runs on install.TARGET_OPERATOR_VERSION(the bundled operator subchart version, resolved from.Chart.Dependencies) for provider-specific upgrade checks — consumed by the skew-window check in the follow-up PR.provider-spec.yamlwith the current provider-sdk (generate: emit spec.release and pass through catalog deprecation flags provider-sdk#40): the spec now carriesrelease.version: 0.1.0from the chartappVersion, which the preflight uses for upgrade-path reporting. NominUpgradableFromfloor yet — nothing older than this release exists to step from.Verification
go build/go testpass;helm templaterenders the hook with the mounted spec, args, andTARGET_OPERATOR_VERSION: "1.22.0". End-to-end hook behavior (blocked vs passing upgrade) is exercised once this and the skew-check PR land together — the §9 walkthrough validation pass.