Skip to content
Open
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
8 changes: 7 additions & 1 deletion internal/controllers/actortemplate_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (

const (
GoldenSnapshotCreationReason = "GoldenSnapshotCreation"

defaultGoldenSnapshotWait = 20 * time.Second
)

type ActorTemplateReconciler struct {
Expand Down Expand Up @@ -108,8 +110,12 @@ func (r *ActorTemplateReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return ctrl.Result{}, fmt.Errorf("while resuming golden actor: %w", err)
}

wait := defaultGoldenSnapshotWait
if at.Spec.GoldenSnapshotWait != nil {
wait = at.Spec.GoldenSnapshotWait.Duration
}
at.Status.Phase = atev1alpha1.PhaseWaitGoldenActor
at.Status.TakeGoldenSnapshotAt = metav1.NewTime(time.Now().Add(20 * time.Second))
at.Status.TakeGoldenSnapshotAt = metav1.NewTime(time.Now().Add(wait))
if err := r.Status().Update(ctx, at); err != nil {
return ctrl.Result{}, err
}
Expand Down
6 changes: 6 additions & 0 deletions manifests/ate-install/generated/ate.dev_actortemplates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ spec:
type: object
maxItems: 10
type: array
goldenSnapshotWait:
description: |-
GoldenSnapshotWait is how long to wait after the golden actor resumes
before taking the snapshot. Slow-booting workloads
may need longer than the 20-second default.
type: string
pauseImage:
description: |-
PauseImage is the container to use as the root sandbox container.
Expand Down
7 changes: 7 additions & 0 deletions pkg/api/v1alpha1/actortemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ type ActorTemplateSpec struct {
//
// +required
Runsc RunscConfig `json:"runsc,omitempty"`

// GoldenSnapshotWait is how long to wait after the golden actor resumes
// before taking the snapshot. Slow-booting workloads
// may need longer than the 20-second default.
//
// +optional
GoldenSnapshotWait *metav1.Duration `json:"goldenSnapshotWait,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this go inside SnapshotConfig

snapshotConfig.goldenSnapshotTimeout

}

type GCPAuthenticationConfig struct {
Expand Down
5 changes: 5 additions & 0 deletions pkg/api/v1alpha1/zz_generated.deepcopy.go

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