Skip to content

Commit

Permalink
feat: add possibility to disable job deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
TrayserCassa committed Oct 25, 2024
1 parent 7714515 commit 422d740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/v1/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ type StoreSpec struct {
ServiceAccountName string `json:"serviceAccountName,omitempty"`

// +kubebuilder:default=false
DisableChecks bool `json:"disableChecks,omitempty"`
DisableChecks bool `json:"disableChecks,omitempty"`
DisableJobDeletion bool `json:"disableJobDeletion,omitempty"`

// +kubebuilder:default={adapter: "builtin"}
SessionCache SessionCacheSpec `json:"sessionCache"`
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/store_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (r *StoreReconciler) doReconcile(
// EDIT: This makes more problems then it will help. So we process the way of terminating to
// the user to close all sidecars correctly.
// Check if sidecars are active
if len(store.Spec.Container.ExtraContainers) > 0 {
if len(store.Spec.Container.ExtraContainers) > 0 && !store.Spec.DisableJobDeletion {
log.Info("Delete setup/migration job if they are finished because sidecars are used")
if err := r.completeJobs(ctx, store); err != nil {
log.Error(err, "Can't cleanup setup and migration jobs")
Expand Down

0 comments on commit 422d740

Please sign in to comment.