@@ -162,13 +162,15 @@ func (r *StoreReconciler) doReconcile(
162
162
// State Initializing
163
163
if store .IsState (v1 .StateInitializing ) {
164
164
// When setup job is still running we will kill it now. This happens when sidecars are used
165
+ // EDIT: This makes more problems then it will help. So we process the way of terminating to
166
+ // the user to close all sidecars correctly.
165
167
// Check if sidecars are active
166
- if len (store .Spec .Container .ExtraContainers ) > 0 {
167
- log .Info ("Delete setup job because sidecars are used" )
168
- if err := r .completeJobs (ctx , store ); err != nil {
169
- return fmt .Errorf ("Can't cleanup setup and migration jobs: %w" , err )
170
- }
171
- }
168
+ // if len(store.Spec.Container.ExtraContainers) > 0 {
169
+ // log.Info("Delete setup job because sidecars are used")
170
+ // if err := r.completeJobs(ctx, store); err != nil {
171
+ // return fmt.Errorf("Can't cleanup setup and migration jobs: %w", err)
172
+ // }
173
+ // }
172
174
173
175
log .Info ("reconcile deployment" )
174
176
if err := r .reconcileDeployment (ctx , store ); err != nil {
@@ -221,34 +223,6 @@ func (r *StoreReconciler) doReconcile(
221
223
return nil
222
224
}
223
225
224
- func (r * StoreReconciler ) completeJobs (ctx context.Context , store * v1.Store ) error {
225
- done , err := job .IsSetupJobCompleted (ctx , r .Client , store )
226
- if err != nil {
227
- return err
228
- }
229
-
230
- // The job is not completed because active containers are running
231
- if ! done {
232
- if err = job .DeleteSetupJob (ctx , r .Client , store ); err != nil {
233
- return err
234
- }
235
- }
236
-
237
- done , err = job .IsMigrationJobCompleted (ctx , r .Client , store )
238
- if err != nil {
239
- return err
240
- }
241
-
242
- // The job is not completed because active containers are running
243
- if ! done {
244
- if err = job .DeleteAllMigrationJobs (ctx , r .Client , store ); err != nil {
245
- return err
246
- }
247
- }
248
-
249
- return nil
250
- }
251
-
252
226
// func (r *StoreReconciler) applyFinalizers(ctx context.Context, store *v1.Store) error {
253
227
// log := log.FromContext(ctx).WithName(store.Name)
254
228
// log.Info("Applying finalizers")
0 commit comments