Skip to content

Commit

Permalink
Add throughput condition (#18982)
Browse files Browse the repository at this point in the history
  • Loading branch information
Furisto authored Oct 30, 2023
1 parent 75713b2 commit 17f7b6c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/ws-manager-api/go/crd/v1/workspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (s *WorkspaceStatus) SetCondition(cond metav1.Condition) {
s.Conditions = wsk8s.AddUniqueCondition(s.Conditions, cond)
}

// +kubebuilder:validation:Enum=Deployed;Failed;Timeout;FirstUserActivity;Closed;HeadlessTaskFailed;StoppedByRequest;Aborted;ContentReady;EverReady;BackupComplete;BackupFailure;Refresh;NodeDisappeared
// +kubebuilder:validation:Enum=Deployed;Failed;Timeout;FirstUserActivity;Closed;HeadlessTaskFailed;StoppedByRequest;Aborted;ContentReady;EverReady;BackupComplete;BackupFailure;Refresh;NodeDisappeared;ThroughputAdjusted
type WorkspaceCondition string

const (
Expand Down Expand Up @@ -243,6 +243,9 @@ const (

// NodeDisappeared is true if the workspace's node disappeared before the workspace was stopped
WorkspaceConditionNodeDisappeared WorkspaceCondition = "NodeDisappeared"

// ThroughputAdjusted is true if the throughput of the workspace volume has been adjusted
WorkspaceConditionThroughputAdjusted WorkspaceCondition = "ThroughputAdjusted"
)

func NewWorkspaceConditionDeployed() metav1.Condition {
Expand Down Expand Up @@ -371,6 +374,14 @@ func NewWorkspaceConditionNodeDisappeared() metav1.Condition {
}
}

func NewWorkspaceConditionThroughputAdjusted() metav1.Condition {
return metav1.Condition{
Type: string(WorkspaceConditionThroughputAdjusted),
LastTransitionTime: metav1.Now(),
Status: metav1.ConditionTrue,
}
}

// +kubebuilder:validation:Enum:=Unknown;Pending;Imagebuild;Creating;Initializing;Running;Stopping;Stopped
type WorkspacePhase string

Expand Down

0 comments on commit 17f7b6c

Please sign in to comment.