Skip to content

Add storage metadata to workspace CR #19044

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

Merged
merged 4 commits into from
Nov 9, 2023
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
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.