@@ -22,8 +22,6 @@ import (
2222 "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
2323 "sigs.k8s.io/controller-runtime/pkg/reconcile"
2424
25- "k8s.io/utils/ptr"
26-
2725 dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
2826 controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1"
2927 "github.com/devfile/devworkspace-operator/internal/images"
@@ -40,6 +38,7 @@ import (
4038 corev1 "k8s.io/api/core/v1"
4139 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4240 "k8s.io/apimachinery/pkg/runtime"
41+ "k8s.io/utils/ptr"
4342 ctrl "sigs.k8s.io/controller-runtime"
4443 "sigs.k8s.io/controller-runtime/pkg/client"
4544 "sigs.k8s.io/controller-runtime/pkg/event"
@@ -253,7 +252,7 @@ func (r *BackupCronJobReconciler) executeBackupSync(ctx context.Context, dwOpera
253252 }
254253 dwOperatorConfig .Status .LastBackupTime = & metav1.Time {Time : metav1 .Now ().Time }
255254
256- err = r .Status ().Patch (ctx , dwOperatorConfig , origConfig )
255+ err = r .NonCachingClient . Status ().Patch (ctx , dwOperatorConfig , origConfig )
257256 if err != nil {
258257 log .Error (err , "Failed to update DevWorkspaceOperatorConfig status with last backup time" )
259258 // Not returning error as the backup jobs were created successfully
@@ -346,12 +345,14 @@ func (r *BackupCronJobReconciler) createBackupJob(
346345 },
347346 Spec : batchv1.JobSpec {
348347 Template : corev1.PodTemplateSpec {
348+ ObjectMeta : metav1.ObjectMeta {
349+ Annotations : map [string ]string {
350+ "io.kubernetes.cri-o.Devices" : "/dev/fuse" ,
351+ },
352+ },
349353 Spec : corev1.PodSpec {
350354 ServiceAccountName : JobRunnerSAName + "-" + workspace .Status .DevWorkspaceId ,
351355 RestartPolicy : corev1 .RestartPolicyNever ,
352- SecurityContext : & corev1.PodSecurityContext {
353- FSGroup : ptr.To [int64 ](0 ),
354- },
355356 Containers : []corev1.Container {
356357 {
357358 Name : "backup-workspace" ,
@@ -363,10 +364,8 @@ func (r *BackupCronJobReconciler) createBackupJob(
363364 Name : "BACKUP_SOURCE_PATH" ,
364365 Value : "/workspace/" + workspacePath ,
365366 },
366- {Name : "STORAGE_DRIVER" , Value : "overlay" },
367- {Name : "BUILDAH_ISOLATION" , Value : "chroot" },
368367 {Name : "DEVWORKSPACE_BACKUP_REGISTRY" , Value : backUpConfig .Registry .Path },
369- {Name : "BUILDAH_PUSH_OPTIONS " , Value : "--tls-verify=false" },
368+ {Name : "PODMAN_PUSH_OPTIONS " , Value : "--tls-verify=false" },
370369 },
371370 Image : images .GetProjectBackupImage (),
372371 Args : []string {
@@ -384,8 +383,7 @@ func (r *BackupCronJobReconciler) createBackupJob(
384383 },
385384 },
386385 SecurityContext : & corev1.SecurityContext {
387- RunAsUser : ptr.To [int64 ](0 ),
388- AllowPrivilegeEscalation : ptr.To [bool ](false ),
386+ RunAsUser : ptr.To [int64 ](1000 ),
389387 },
390388 },
391389 },
@@ -424,12 +422,12 @@ func (r *BackupCronJobReconciler) createBackupJob(
424422 })
425423 job .Spec .Template .Spec .Containers [0 ].VolumeMounts = append (job .Spec .Template .Spec .Containers [0 ].VolumeMounts , corev1.VolumeMount {
426424 Name : "registry-auth-secret" ,
427- MountPath : "/home/user /.docker" ,
425+ MountPath : "/home/podman /.docker" ,
428426 ReadOnly : true ,
429427 })
430428 job .Spec .Template .Spec .Containers [0 ].Env = append (job .Spec .Template .Spec .Containers [0 ].Env , corev1.EnvVar {
431429 Name : "REGISTRY_AUTH_FILE" ,
432- Value : "/home/user /.docker/.dockerconfigjson" ,
430+ Value : "/home/podman /.docker/.dockerconfigjson" ,
433431 })
434432
435433 }
0 commit comments