Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 68
OCPCRT-598: Fix CRD/annotation phase desync for release signing#810
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
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -390,6 +390,13 @@ func (c *Controller) syncPending(release *releasecontroller.Release, pendingTags | ||
| return err | ||
| } | ||
| c.precacheChangelog(release, tag) | ||
| case releasecontroller.ReleasePhaseAccepted: | ||
| if err := c.markReleaseReady(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| if err := c.markReleaseAccepted(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| case releasecontroller.ReleasePhaseFailed: | ||
| if err := c.transitionReleasePhaseFailure(release, []string{releasecontroller.ReleasePhasePending}, releasecontroller.ReleasePhaseFailed, reasonAndMessage("CreateReleaseFailed", "Could not create the release image"), tag.Name); err != nil { | ||
| return err | ||
| @@ -445,6 +452,13 @@ func (c *Controller) syncPending(release *releasecontroller.Release, pendingTags | ||
| return err | ||
| } | ||
| c.precacheChangelog(release, tag) | ||
| case releasecontroller.ReleasePhaseAccepted: | ||
| if err := c.markReleaseReady(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| if err := c.markReleaseAccepted(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| case releasecontroller.ReleasePhaseFailed: | ||
| if err := c.transitionReleasePhaseFailure(release, []string{releasecontroller.ReleasePhasePending}, releasecontroller.ReleasePhaseFailed, reasonAndMessage("CreateReleaseFailed", "Could not create the release image"), tag.Name); err != nil { | ||
| return err | ||
| @@ -520,6 +534,31 @@ func (c *Controller) syncAccepted(release *releasecontroller.Release) error { | ||
| klog.Infof("release=%s accepted=%v", release.Config.Name, releasecontroller.TagNames(acceptedTags)) | ||
| } | ||
| for _, tag := range acceptedTags { | ||
| annotationPhase := tag.Annotations[releasecontroller.ReleaseAnnotationPhase] | ||
| if annotationPhase == releasecontroller.ReleasePhaseAccepted { | ||
| continue | ||
| } | ||
| klog.V(2).Infof("Reconciling phase for %s: annotation=%q, payload=Accepted", tag.Name, annotationPhase) | ||
| switch annotationPhase { | ||
| case releasecontroller.ReleasePhasePending, "": | ||
| if err := c.markReleaseReady(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| if err := c.markReleaseAccepted(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| case releasecontroller.ReleasePhaseReady: | ||
| if err := c.markReleaseAccepted(release, nil, tag.Name); err != nil { | ||
| return err | ||
| } | ||
| default: | ||
| klog.Warningf("Tag %s has payload Accepted but annotation phase %q; skipping reconciliation", tag.Name, annotationPhase) | ||
| continue | ||
| } | ||
| return nil | ||
Comment on lines
+555
to
+559
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win Block publishing when annotation reconciliation is skipped. When 🤖 Prompt for AI Agents | ||
| } | ||
| if len(release.Config.Publish) == 0 || len(acceptedTags) == 0 { | ||
| return nil | ||
| } | ||
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.
🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win
Preserve changelog pre-caching on every new fast path.
Each new Pending/Accepted → Ready → Accepted path bypasses the
c.precacheChangelogcall used by the existing Ready path.cmd/release-controller/sync.go#L393-L399: callc.precacheChangelog(release, tag)aftermarkReleaseReady.cmd/release-controller/sync.go#L455-L461: add the same call beforemarkReleaseAccepted.cmd/release-controller/sync.go#L544-L550: add the same call between the two phase transitions.📍 Affects 1 file
cmd/release-controller/sync.go#L393-L399(this comment)cmd/release-controller/sync.go#L455-L461cmd/release-controller/sync.go#L544-L550🤖 Prompt for AI Agents