Skip to content
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

feat: add possibility to disable job deletion #60

Merged
merged 1 commit into from
Oct 25, 2024
Merged
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
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
Loading