Fix inconsistent lastTransitionTime format causing 2.6→2.7 upgrade failure - #279
Open
skashid1882 wants to merge 2 commits into
Open
skashid1882 wants to merge 2 commits into
skashid1882 wants to merge 2 commits into
Conversation
The k8s_status module in older operator_sdk.util versions occasionally
wrote status condition timestamps using Python's str(datetime) which
produces space-separated format ("YYYY-MM-DD HH:MM:SS+00:00") instead
of the RFC3339-mandated T-separated format ("YYYY-MM-DDTHH:MM:SS+00:00").
Conditions whose status never transitions (e.g. Routes-Ready once set)
retain the malformed value indefinitely. When upgrading from AAP 2.6 to
2.7, the tightened CRD validation rejects these values, blocking the
InstallPlan with "must be of type date-time".
This adds a normalization step early in reconciliation that detects and
patches any space-separated timestamps to proper RFC3339 format, ensuring
clean upgrades through supported paths.
Fixes: AAP-86911
Co-authored-by: Cursor <cursoragent@cursor.com>
skashid1882
force-pushed
the
fix/normalize-lastTransitionTime-format-AAP-86911
branch
from
August 21, 2026 12:51
46d5e63 to
79492a2
Compare
The k8s_status module's merge_status_conditions() calls has_condition_transitioned() which explicitly ignores lastTransitionTime changes. This caused the normalization patch to be silently discarded as a no-op. Using replace: true with the full status object bypasses the merge logic entirely. Fixes: AAP-86911 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
commonrole that detects and patches anylastTransitionTimevalues written in space-separated format (YYYY-MM-DD HH:MM:SS+00:00) to proper RFC3339 (YYYY-MM-DDTHH:MM:SS+00:00)Routes-Ready) are fixed before CRD validation on upgradeInstallComponentFailederrors during supported AAP 2.6 → 2.7 upgrades caused by the tighteneddate-timeformat constraint in the 2.7 CRDRoot Cause
The
k8s_statusmodule (operator_sdk.util) in certain code paths uses Python'sstr(datetime.now(timezone.utc))which produces a space between date and time, rather than.isoformat()which produces the requiredTseparator. Conditions whose status never flips (sameTrue/Falsevalue) retain the original malformed timestamp indefinitely because the module only rewriteslastTransitionTimeon actual transitions.Changes
roles/common/tasks/normalize_condition_timestamps.ymlroles/common/tasks/main.ymlCHANGES/86911.bugfixTest Plan
lastTransitionTimevalues are now T-separatedFixes: AAP-86911
Made with Cursor