@@ -49,6 +49,29 @@ type OperatorConfiguration struct {
49
49
EnableExperimentalFeatures * bool `json:"enableExperimentalFeatures,omitempty"`
50
50
}
51
51
52
+ type CleanupCronJobConfig struct {
53
+ // Enable determines whether the cleanup cron job is enabled.
54
+ // Defaults to false if not specified.
55
+ // +kubebuilder:validation:Optional
56
+ Enable * bool `json:"enable,omitempty"`
57
+ // RetainTime specifies the minimum time (in seconds) since a DevWorkspace was last started before it is considered stale and eligible for cleanup.
58
+ // For example, a value of 2592000 (30 days) would mean that any DevWorkspace that has not been started in the last 30 days will be deleted.
59
+ // Defaults to 2592000 seconds (30 days) if not specified.
60
+ // +kubebuilder:validation:Minimum=0
61
+ // +kubebuilder:default:=2592000
62
+ // +kubebuilder:validation:Optional
63
+ RetainTime * int32 `json:"retainTime,omitempty"`
64
+ // DryRun determines whether the cleanup cron job should be run in dry-run mode.
65
+ // If set to true, the cron job will not delete any DevWorkspaces, but will log the DevWorkspaces that would have been deleted.
66
+ // Defaults to false if not specified.
67
+ // +kubebuilder:validation:Optional
68
+ DryRun * bool `json:"dryRun,omitempty"`
69
+ // Schedule specifies the cron schedule for the cleanup cron job.
70
+ // +kubebuilder:default:="0 0 1 * *"
71
+ // +kubebuilder:validation:Optional
72
+ Schedule string `json:"schedule,omitempty"`
73
+ }
74
+
52
75
type RoutingConfig struct {
53
76
// DefaultRoutingClass specifies the routingClass to be used when a DevWorkspace
54
77
// specifies an empty `.spec.routingClass`. Supported routingClasses can be defined
@@ -161,6 +184,8 @@ type WorkspaceConfig struct {
161
184
PodAnnotations map [string ]string `json:"podAnnotations,omitempty"`
162
185
// RuntimeClassName defines the spec.runtimeClassName for DevWorkspace pods created by the DevWorkspace Operator.
163
186
RuntimeClassName * string `json:"runtimeClassName,omitempty"`
187
+ // CleanupCronJobConfig defines configuration options for a cron job that automatically cleans up stale DevWorkspaces.
188
+ CleanupCronJob * CleanupCronJobConfig `json:"cleanupCronJob,omitempty"`
164
189
}
165
190
166
191
type WebhookConfig struct {
0 commit comments