Skip to content
Draft
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
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Amalthea",
"image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
"image": "mcr.microsoft.com/devcontainers/python:2.1.2-3.12-trixie",
"build": {
"args": {
"DEV_BUILD": true
Expand All @@ -14,7 +14,9 @@
"yqVersion": "latest"
},
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": false,
},
"ghcr.io/mpriscella/features/kind:1": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {
"minikube": "none"
Expand Down
4 changes: 4 additions & 0 deletions api/v1alpha1/amaltheasession_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ type Culling struct {
// +kubebuilder:default:="300m"
// Number of CPU cores that determine a session to be idling.
CPUIdleThreshold resource.Quantity `json:"cpuIdleThreshold,omitempty"`
// +optional
// +kubebuilder:validation:Format:=date-time
// +kubebuilder:validation:Type:=string
ResumeAt metav1.Time `json:"resumeAt,omitempty"`
}

// +kubebuilder:validation:Enum={token,oauth2proxy,oidc}
Expand Down
1 change: 1 addition & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion bundle/manifests/amalthea.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ metadata:
}
]
capabilities: Basic Install
createdAt: "2025-06-25T07:56:15Z"
createdAt: "2026-01-26T13:16:58Z"
operators.operatorframework.io/builder: operator-sdk-v1.38.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v4
name: amalthea.v0.0.1
Expand Down
3 changes: 3 additions & 0 deletions bundle/manifests/amalthea.dev_amaltheasessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,9 @@ spec:
valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
format: duration
type: string
resumeAt:
format: date-time
type: string
type: object
dataSources:
description: A list of data sources that should be added to the session
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/amalthea.dev_amaltheasessions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,9 @@ spec:
valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
format: duration
type: string
resumeAt:
format: date-time
type: string
type: object
dataSources:
description: A list of data sources that should be added to the session
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: example.com/amalthea
newTag: v0.0.1
newName: controller
newTag: latest
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,9 @@ spec:
valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
format: duration
type: string
resumeAt:
format: date-time
type: string
type: object
dataSources:
description: A list of data sources that should be added to the session
Expand Down
17 changes: 17 additions & 0 deletions internal/controller/amaltheasession_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,23 @@ func (r *AmaltheaSessionReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return ctrl.Result{}, err
}

if amaltheasession.Spec.Culling.ResumeAt.After(time.Now()) {

// If session is not hibernated, remove the resumeAt
if !amaltheasession.Spec.Hibernated {
amaltheasession.Spec.Culling.ResumeAt = time.Time{}
return ctrl.Result{}, nil
}

// Set hibernated to false
amaltheasession.Spec.Hibernated = false

// remove resumeAt
amaltheasession.Spec.Culling.ResumeAt = time.Time{}

return ctrl.Result{}, nil
}

if amaltheasession.GetDeletionTimestamp() == nil {
if reflect.DeepEqual(amaltheasession.Status, amaltheadevv1alpha1.AmaltheaSessionStatus{State: amaltheadevv1alpha1.NotReady, Idle: false}) {
// First status update/render
Expand Down
Loading