@@ -490,30 +490,30 @@ func (r *DevWorkspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request
490490 // Inject operator-configured init containers
491491 if workspace .Config != nil && workspace .Config .Workspace != nil && len (workspace .Config .Workspace .InitContainers ) > 0 {
492492 // Check if init-persistent-home should be disabled
493- disableHomeInit := workspace .Config .Workspace .PersistUserHome .DisableInitContainer != nil &&
494- * workspace .Config .Workspace .PersistUserHome .DisableInitContainer
493+ disableHomeInit := pointer .BoolDeref (workspace .Config .Workspace .PersistUserHome .DisableInitContainer , false )
495494
496495 // Prepare patches: filter and preprocess init containers from config
497496 patches := []corev1.Container {}
498- for _ , c := range workspace .Config .Workspace .InitContainers {
497+ for _ , container := range workspace .Config .Workspace .InitContainers {
499498 // Special handling for init-persistent-home
500- if c .Name == constants .HomeInitComponentName {
499+ if container .Name == constants .HomeInitComponentName {
501500 // Skip if persistent home is disabled
502501 if ! home .PersistUserHomeEnabled (workspace ) {
502+ reqLogger .Info ("Skipping init-persistent-home container: persistent home is disabled" )
503503 continue
504504 }
505505 // Skip if init container is explicitly disabled
506506 if disableHomeInit {
507+ reqLogger .Info ("Skipping init-persistent-home container: DisableInitContainer is true" )
507508 continue
508509 }
509510 // Apply defaults and validation for init-persistent-home
510- validated , err : = defaultAndValidateHomeInitContainer (c , workspace )
511+ container , err = defaultAndValidateHomeInitContainer (container , workspace )
511512 if err != nil {
512513 return r .failWorkspace (workspace , fmt .Sprintf ("Invalid %s container: %s" , constants .HomeInitComponentName , err ), metrics .ReasonBadRequest , reqLogger , & reconcileStatus ), nil
513514 }
514- c = validated
515515 }
516- patches = append (patches , c )
516+ patches = append (patches , container )
517517 }
518518
519519 // Perform strategic merge
0 commit comments