Skip to content

Commit

Permalink
Add storage metadata to workspace CR (#19044)
Browse files Browse the repository at this point in the history
* Adding volume fields to workspace CRs

* Move workspace volume details to status

* Add VolumeAttachRequest condition

* Add throughput condition (#18982)

---------

Co-authored-by: Alejandro de Brito Fontes <[email protected]>
Co-authored-by: Thomas Schubart <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent b786da1 commit 9331ac5
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/ws-manager-api/go/crd/v1/workspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,21 @@ type WorkspaceStatus struct {
// +kubebuilder:validation:Optional
Runtime *WorkspaceRuntimeStatus `json:"runtime,omitempty"`

Storage StorageStatus `json:"storage,omitempty"`

LastActivity *metav1.Time `json:"lastActivity,omitempty"`
}

func (s *WorkspaceStatus) SetCondition(cond metav1.Condition) {
s.Conditions = wsk8s.AddUniqueCondition(s.Conditions, cond)
}

type StorageStatus struct {
VolumeName string `json:"volumeName"`
AttachedDevice string `json:"attachedDevice"`
MountPath string `json:"mountPath"`
}

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

Expand Down Expand Up @@ -244,6 +252,11 @@ const (
// NodeDisappeared is true if the workspace's node disappeared before the workspace was stopped
WorkspaceConditionNodeDisappeared WorkspaceCondition = "NodeDisappeared"

VolumeAttachRequest WorkspaceCondition = "VolumeAttachRequest"
// VolumeAttached is true if the workspace's volume has been attached to the node
VolumeAttached WorkspaceCondition = "VolumeAttached"
// VolumeMounted is true if the workspace's volume has been mounted on the node
VolumeMounted WorkspaceCondition = "VolumeMounted"
// ThroughputAdjusted is true if the throughput of the workspace volume has been adjusted
WorkspaceConditionThroughputAdjusted WorkspaceCondition = "ThroughputAdjusted"
)
Expand Down
16 changes: 16 additions & 0 deletions components/ws-manager-api/go/crd/v1/zz_generated.deepcopy.go

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

0 comments on commit 9331ac5

Please sign in to comment.