-
Notifications
You must be signed in to change notification settings - Fork 66
feat(23570): Add controller for workspace backup #1530
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
base: main
Are you sure you want to change the base?
Changes from all commits
1480c98
d1a8f94
b5bbebd
307145c
51b3eec
9b0ed96
c282a59
aa1053d
b99674a
9c41684
b0f56b3
4be0f98
c4a958c
2e99b7e
cbc61d8
afacdec
efe0538
18be365
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,36 @@ type CleanupCronJobConfig struct { | |
| Schedule string `json:"schedule,omitempty"` | ||
| } | ||
|
|
||
| type RegistryConfig struct { | ||
| // A registry where backup images are stored. Images are stored | ||
| // in {registry}/backup-${DEVWORKSPACE_NAMESPACE}-${DEVWORKSPACE_NAME} | ||
| // +kubebuilder:validation:Required | ||
| Path string `json:"path,omitempty"` | ||
| // AuthSecret is the name of a Kubernetes secret of | ||
| // type kubernetes.io/dockerconfigjson | ||
| // +kubebuilder:validation:Optional | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it would help clarify that the |
||
| AuthSecret string `json:"authSecret,omitempty"` | ||
|
|
||
| // ExtraArgs are additional arguments passed to the oras CLI | ||
| // +kubebuilder:validation:Optional | ||
| ExtraArgs string `json:"extraArgs,omitempty"` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the intended use case for passing arbitrary |
||
| } | ||
|
|
||
| type BackupCronJobConfig struct { | ||
tolusha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // Enable determines whether backup CronJobs should be created for workspace PVCs. | ||
| // Defaults to false if not specified. | ||
| // +kubebuilder:validation:Optional | ||
| Enable *bool `json:"enable,omitempty"` | ||
rohanKanojia marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // RegistryConfig defines the registry configuration where backup images are stored. | ||
| // +kubebuilder:validation:Required | ||
| Registry *RegistryConfig `json:"registry,omitempty"` | ||
| // Schedule specifies the cron schedule for the backup cron job. | ||
| // For example, "0 2 * * *" runs daily at 2 AM. | ||
| // +kubebuilder:default:="0 2 * * *" | ||
| // +kubebuilder:validation:Optional | ||
| Schedule string `json:"schedule,omitempty"` | ||
| } | ||
|
|
||
| type RoutingConfig struct { | ||
| // DefaultRoutingClass specifies the routingClass to be used when a DevWorkspace | ||
| // specifies an empty `.spec.routingClass`. Supported routingClasses can be defined | ||
|
|
@@ -189,6 +219,8 @@ type WorkspaceConfig struct { | |
| RuntimeClassName *string `json:"runtimeClassName,omitempty"` | ||
| // CleanupCronJobConfig defines configuration options for a cron job that automatically cleans up stale DevWorkspaces. | ||
| CleanupCronJob *CleanupCronJobConfig `json:"cleanupCronJob,omitempty"` | ||
| // BackupCronJobConfig defines configuration options for a cron job that automatically backs up workspace PVCs. | ||
| BackupCronJob *BackupCronJobConfig `json:"backupCronJob,omitempty"` | ||
| // PostStartTimeout defines the maximum duration the PostStart hook can run | ||
| // before it is automatically failed. This timeout is used for the postStart lifecycle hook | ||
| // that is used to run commands in the workspace container. The timeout is specified in seconds. | ||
|
|
@@ -331,14 +363,26 @@ type ConfigmapReference struct { | |
| Namespace string `json:"namespace"` | ||
| } | ||
|
|
||
| type OperatorConfigurationStatus struct { | ||
| // Conditions represent the latest available observations of the OperatorConfiguration's state | ||
| Conditions []metav1.Condition `json:"conditions,omitempty"` | ||
| // LastBackupTime is the timestamp of the last successful backup. Nil if | ||
| // no backup is configured or no backup has yet succeeded. | ||
| LastBackupTime *metav1.Time `json:"lastBackupTime,omitempty"` | ||
Allda marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| // DevWorkspaceOperatorConfig is the Schema for the devworkspaceoperatorconfigs API | ||
| // +kubebuilder:object:root=true | ||
| // +kubebuilder:subresource:status | ||
| // +kubebuilder:resource:path=devworkspaceoperatorconfigs,scope=Namespaced,shortName=dwoc | ||
| type DevWorkspaceOperatorConfig struct { | ||
| metav1.TypeMeta `json:",inline"` | ||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
|
||
| Config *OperatorConfiguration `json:"config,omitempty"` | ||
| // Status represents the current status of the DevWorkspaceOperatorConfig | ||
| // automatically managed by the DevWorkspace Operator. | ||
| Status *OperatorConfigurationStatus `json:"status,omitempty"` | ||
| } | ||
|
|
||
| // DevWorkspaceOperatorConfigList contains a list of DevWorkspaceOperatorConfig | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.