Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
58 changes: 53 additions & 5 deletions config/v1/types_cluster_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,19 @@ type ClusterVersionSpec struct {
// progress, or is failing.
// +k8s:deepcopy-gen=true
type ClusterVersionStatus struct {
// current is the version that the cluster will be reconciled to. This
// value may be empty during cluster startup, and then will be set whenever
// a new update is being applied. Use the conditions array to know whether
// the update is complete.
Current Update `json:"current"`
// desired is the version that the cluster is reconciling towards.
// If the cluster is not yet fully initialized desired will be set
// with the information available, which may be a payload or a tag.
Desired Update `json:"desired"`

// history contains a list of the most recent versions applied to the cluster.
// This value may be empty during cluster startup, and then will be updated
// when a new update is being applied. The newest update is first in the
// list and it is ordered by recency. Updates in the history have state
// Completed if the rollout completed - if an update was failing or halfway
// applied the state will be Partial. Only a limited amount of update history
// is preserved.
History []UpdateHistory `json:"history"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

document the ordering. Most recent to least recent or least recent to most recent


// generation reports which version of the spec is being processed.
// If this value is not equal to metadata.generation, then the
Expand Down Expand Up @@ -106,6 +114,46 @@ type ClusterVersionStatus struct {
AvailableUpdates []Update `json:"availableUpdates"`
}

// UpdateState is a constant representing whether an update was successfully
// applied to the cluster or not.
type UpdateState string

const (
// CompletedUpdate indicates an update was successfully applied
// to the cluster (all resource updates were successful).
CompletedUpdate UpdateState = "Completed"
// PartialUpdate indicates an update was never completely applied
// or is currently being applied.
PartialUpdate UpdateState = "Partial"
)

// UpdateHistory is a single attempted update to the cluster.
type UpdateHistory struct {
Comment thread
abhinavdahiya marked this conversation as resolved.
// state reflects whether the update was fully applied. The Partial state
// indicates the update is not fully applied, while the Completed state
// indicates the update was successfully rolled out at least once (all
// parts of the update successfully applied).
State UpdateState `json:"state"`

// startedTime is the time at which the update was started.
StartedTime metav1.Time `json:"startedTime"`
// completionTime, if set, is when the update was fully applied. The update
// that is currently being applied will have a null completion time.
// Completion time will always be set for entries that are not the current
// update (usually to the started time of the next update).
CompletionTime *metav1.Time `json:"completionTime"`

// version is a semantic versioning identifying the update version. If the
// requested payload does not define a version, or if a failure occurs
// retrieving the payload, this value may be empty.
//
// +optional
Version string `json:"version"`
// payload is a container image location that contains the update. This value
// is always populated.
Payload string `json:"payload"`
}

// ClusterID is string RFC4122 uuid.
type ClusterID string

Expand Down
34 changes: 33 additions & 1 deletion config/v1/zz_generated.deepcopy.go

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