Skip to content
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

Compute global rollout state #49945

Merged
merged 6 commits into from
Dec 10, 2024
Merged

Conversation

hugoShaka
Copy link
Contributor

@hugoShaka hugoShaka commented Dec 9, 2024

Part of: RFD-184 (although this is not specified in the RFD, during implementation we concluded that it would make cloud's logic easier).

Goal (internal): https://github.com/gravitational/cloud/issues/10289

This PR adds a autoupdate_agent_rollout.status.state field summarizing the rollout state.
This field will help cloud understand what's the rollout state and if they can update the version.
See example logic in cloud's draft PR (internal): https://github.com/gravitational/cloud/pull/11362/files#diff-599c9d7aefb92d10d6cc7fc837528b5457090c7084e503f23ff0437de8f0f652R66-R70

@hugoShaka hugoShaka added no-changelog Indicates that a PR does not require a changelog entry automatic-upgrades labels Dec 9, 2024
@hugoShaka hugoShaka requested review from sclevine and vapopov December 9, 2024 18:01
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-49945.d3pp5qlev8mo18.amplifyapp.com

@hugoShaka hugoShaka enabled auto-merge December 9, 2024 19:24
if groupCount == 0 {
return autoupdate.AutoUpdateAgentRolloutState_AUTO_UPDATE_AGENT_ROLLOUT_STATE_UNSPECIFIED
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do it something like

Suggested change
var done, unstarted int
for _, group := range groups {
switch group.State {
case ROLLEDBACK: return ROLLEDBACK
case DONE: done++
case UNSTARTED: unstarted++
}
}
if done == groupCount { return DONE }
if unstarted == groupCount { return UNSTARTED }
return ACTIVE
}

@hugoShaka hugoShaka added this pull request to the merge queue Dec 10, 2024
Merged via the queue into master with commit aaf58ac Dec 10, 2024
44 checks passed
@hugoShaka hugoShaka deleted the hugo/global-agent-rollout-status branch December 10, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automatic-upgrades no-changelog Indicates that a PR does not require a changelog entry size/md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants