Skip to content

get latest release should not include demoted#723

Merged
marccampbell merged 3 commits into
mainfrom
ignore-demoted
May 18, 2026
Merged

get latest release should not include demoted#723
marccampbell merged 3 commits into
mainfrom
ignore-demoted

Conversation

@marccampbell
Copy link
Copy Markdown
Member

problem: GetCurrentChannelRelease defines current as the release with the highest channel sequence in both the embedded-release and fallback paths. ChannelRelease explicitly carries demotion state, but neither path excludes IsDemoted releases. If the latest promoted release was demoted, commands that ask for the current channel release can operate on the demoted release instead of the active one, returning stale or intentionally removed release data such as image lists and proxy metadata.

solution:
When selecting the current release, skip releases with IsDemoted set. If all releases are demoted, return a clear no active release error. Keep the same filtering in both the kotsChannel.Releases path and the ListChannelReleases fallback path.

NoaheCampbell
NoaheCampbell previously approved these changes May 17, 2026
Comment thread client/channel.go Outdated
return nil, "", errors.Errorf("unknown app type %q", appType)
}

func currentChannelRelease(releases []types.ChannelRelease) *types.ChannelRelease {
Copy link
Copy Markdown
Member

@divolgin divolgin May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't account for semver sorting, but I also believe the API should be sorting releases already. There should also be current release fields set on the channel response: https://replicated-vendor-api.readme.io/reference/getchannelproperties-1 (I see latestChannelSequence, releaseSequence and currentVersion fields)

marccampbell and others added 2 commits May 18, 2026 14:01
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@marccampbell marccampbell merged commit 31b9755 into main May 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants