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

feat: add rollout API spec #897

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apis/cluster/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions apis/placement/v1alpha1/stagedupdate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ type StagedUpdateRunStatus struct {
// +kubebuilder:validation:Optional
DeletionStageStatus StageUpdatingStatus `json:"deletionStageStatus,omitempty"`

// CurrentUpdatingStage is the name of the stage that is in the middle of the update.
// If the update run is not started, the value is an empty string.
// If we are in the DeletionStage, the name is called "deletionStage".
// +kubebuilder:validation:Optional
CurrentUpdatingStage string `json:"currentUpdatingStage,omitempty"`

// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
Expand Down Expand Up @@ -248,6 +242,12 @@ type StageUpdatingStatus struct {
// +kubebuilder:validation:Format=date-time
StartTime *metav1.Time `json:"startTime,omitempty"`
ryanzhang-oss marked this conversation as resolved.
Show resolved Hide resolved

// The time when the update finished on the stage. Empty if the stage has not started updating.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
EndTime *metav1.Time `json:"endTime,omitempty"`

// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
Expand Down Expand Up @@ -296,19 +296,13 @@ type ClusterUpdatingStatus struct {
// +kubebuilder:validation:Optional
ClusterResourceOverrideSnapshots []string `json:"clusterResourceOverrideSnapshots,omitempty"`

// The time when the update started on the cluster. Empty if the cluster has not started updating.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Format=date-time
StartTime *metav1.Time `json:"startTime,omitempty"`

// +patchMergeKey=type
// +patchStrategy=merge
// +listType=map
// +listMapKey=type
//
// Conditions is an array of current observed conditions for clusters. Empty if the cluster has not started updating.
// Known condition is "Succeeded".
// Known conditions are "Started,"Succeeded".
ryanzhang-oss marked this conversation as resolved.
Show resolved Hide resolved
// +kubebuilder:validation:Optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
Expand All @@ -318,6 +312,12 @@ type ClusterUpdatingStatus struct {
type ClusterUpdatingStatusConditionType string

const (
// UpdatingStatusConditionTypeStarted indicates whether the cluster updating has started.
// Its condition status can be one of the following:
// - "True" means the cluster updating has started.
// - "False" means the stage updating has not started.
UpdatingStatusConditionTypeStarted ClusterUpdatingStatusConditionType = "Started"

// UpdatingStatusConditionTypeSucceeded indicates whether the cluster updating is completed successfully.
// Its condition status can be one of the following:
// - "True" means the cluster updating is completed successfully.
Expand Down Expand Up @@ -401,7 +401,7 @@ type StagedUpdateRunList struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ApprovalRequest defines a request for the approval from the user.
// Each snapshot MUST have the following labels:
// The request object MUST have the following labels:
// - `TargetUpdateRun` which points to the update run that this approval request is for.
// - `TargetStage` which is the name of the stage that this approval request is for.
// - `IsLatestUpdateRunApproval` which indicates whether this approval request is the latest one related to this update run.
ryanzhang-oss marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
13 changes: 6 additions & 7 deletions apis/placement/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/placement/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
openAPIV3Schema:
description: |-
ApprovalRequest defines a request for the approval from the user.
Each snapshot MUST have the following labels:
The request object MUST have the following labels:
- `TargetUpdateRun` which points to the update run that this approval request is for.
- `TargetStage` which is the name of the stage that this approval request is for.
- `IsLatestUpdateRunApproval` which indicates whether this approval request is the latest one related to this update run.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,6 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
currentUpdatingStage:
description: |-
CurrentUpdatingStage is the name of the stage that is in the middle of the update.
If the update run is not started, the value is an empty string.
If we are in the DeletionStage, the name is called "deletionStage".
type: string
deletionStageStatus:
description: |-
DeletionStageStatus list the current status of the deletion stage. The deletion stage is
Expand Down Expand Up @@ -357,7 +351,7 @@ spec:
conditions:
description: |-
Conditions is an array of current observed conditions for clusters. Empty if the cluster has not started updating.
Known condition is "Succeeded".
Known conditions are "Started,"Succeeded".
items:
description: "Condition contains details for one aspect
of the current state of this API Resource.\n---\nThis
Expand Down Expand Up @@ -454,11 +448,6 @@ spec:
- namespace
type: object
type: array
startTime:
description: The time when the update started on the cluster.
Empty if the cluster has not started updating.
format: date-time
type: string
required:
- clusterName
type: object
Expand Down Expand Up @@ -540,6 +529,11 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
endTime:
description: The time when the update finished on the stage. Empty
if the stage has not started updating.
format: date-time
type: string
stageName:
description: The name of the stage.
type: string
Expand Down Expand Up @@ -805,7 +799,7 @@ spec:
conditions:
description: |-
Conditions is an array of current observed conditions for clusters. Empty if the cluster has not started updating.
Known condition is "Succeeded".
Known conditions are "Started,"Succeeded".
items:
description: "Condition contains details for one aspect
of the current state of this API Resource.\n---\nThis
Expand Down Expand Up @@ -902,11 +896,6 @@ spec:
- namespace
type: object
type: array
startTime:
description: The time when the update started on the cluster.
Empty if the cluster has not started updating.
format: date-time
type: string
required:
- clusterName
type: object
Expand Down Expand Up @@ -989,6 +978,11 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
endTime:
description: The time when the update finished on the stage.
Empty if the stage has not started updating.
format: date-time
type: string
stageName:
description: The name of the stage.
type: string
Expand Down
2 changes: 1 addition & 1 deletion test/apis/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading