Skip to content

Conversation

@Arvindthiru
Copy link
Collaborator

@Arvindthiru Arvindthiru commented Oct 29, 2025

Description of your changes

This PR aims to add new API changes to allow users to set the following intent on an updateRun,

  • Started
  • Stopped
  • Abandoned

Adding a new spec field called state which is an enum
Adding another condition type for updateRun status called Abandoned

Fixes #

I have:

  • Run make reviewable to ensure this PR is ready for review.

How has this code been tested

Special notes for your reviewer

@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Arvind Thirumurugan added 10 commits November 6, 2025 15:08
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>

const (
// StateNotStarted indicates the update run has been initialized but execution has not started.
// This is the default state after initialization completes.
Copy link
Contributor

Choose a reason for hiding this comment

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

The state here is the "desired" state set by the user but the whole description makes this look like a status instead of spec.

PlacementName: crpName,
ResourceSnapshotIndex: resourceSnapshotIndex,
StagedUpdateStrategyName: strategyName,
State: placementv1beta1.StateStarted,
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't the default be "stateNotStarted"? It's the default so we don't need to add it?

Copy link
Collaborator Author

@Arvindthiru Arvindthiru Nov 7, 2025

Choose a reason for hiding this comment

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

Field validation fails if value is state is not specified

Image

I tried applying the object using an yaml file it set the default value correctly but when it's go struct field validation kicks in before the default value is set. Since our updateRuns start by default I set it to StateStarted for now

Arvind Thirumurugan added 6 commits November 7, 2025 12:14
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
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