You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// State represents the desired state of an update run.
151
+
// +enum
152
+
typeStatestring
153
+
154
+
const (
155
+
// StateNotStarted describes user intent to initialize but not execute the update run.
156
+
// This is the default state when an update run is created.
157
+
StateNotStartedState="NotStarted"
158
+
159
+
// StateStarted describes user intent to execute (or resume execution if paused).
160
+
// Users can subsequently set the state to Stopped or Abandoned.
161
+
StateStartedState="Started"
162
+
163
+
// StateStopped describes user intent to pause the update run.
164
+
// Users can subsequently set the state to Started or Abandoned.
165
+
StateStoppedState="Stopped"
166
+
167
+
// StateAbandoned describes user intent to abandon the update run.
168
+
// This is a terminal state; once set, it cannot be changed.
169
+
StateAbandonedState="Abandoned"
170
+
)
171
+
150
172
// UpdateRunSpec defines the desired rollout strategy and the snapshot indices of the resources to be updated.
151
173
// It specifies a stage-by-stage update process across selected clusters for the given ResourcePlacement object.
174
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.state) || oldSelf.state != 'NotStarted' || self.state != 'Stopped'",message="invalid state transition: cannot transition from NotStarted to Stopped"
175
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.state) || oldSelf.state != 'Started' || self.state != 'NotStarted'",message="invalid state transition: cannot transition from Started to NotStarted"
176
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.state) || oldSelf.state != 'Stopped' || self.state != 'NotStarted'",message="invalid state transition: cannot transition from Stopped to NotStarted"
177
+
// +kubebuilder:validation:XValidation:rule="!has(oldSelf.state) || oldSelf.state != 'Abandoned' || self.state == 'Abandoned'",message="invalid state transition: Abandoned is a terminal state and cannot transition to any other state"
152
178
typeUpdateRunSpecstruct {
153
179
// PlacementName is the name of placement that this update run is applied to.
154
180
// There can be multiple active update runs for each placement, but
155
181
// it's up to the DevOps team to ensure they don't conflict with each other.
156
182
// +kubebuilder:validation:Required
157
183
// +kubebuilder:validation:MaxLength=255
184
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="placementName is immutable"
158
185
PlacementNamestring`json:"placementName"`
159
186
160
187
// The resource snapshot index of the selected resources to be updated across clusters.
161
188
// The index represents a group of resource snapshots that includes all the resources a ResourcePlacement selected.
162
189
// +kubebuilder:validation:Required
190
+
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="resourceSnapshotIndex is immutable"
0 commit comments