diff --git a/internal/k8s/job_manifests.go b/internal/k8s/job_manifests.go index be48988..b975245 100644 --- a/internal/k8s/job_manifests.go +++ b/internal/k8s/job_manifests.go @@ -14,6 +14,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const cachePath = "/cache" + func buildBackupJob(cfg *config.Config, req api.BackupRequest, jobName, secretName, repository string, dedupeEnabled bool, keepLast int) *batchv1.Job { labels := map[string]string{ labelAppName: "soteria", @@ -42,7 +44,7 @@ func buildBackupJob(cfg *config.Config, req api.BackupRequest, jobName, secretNa Resources: jobResources(cfg), VolumeMounts: []corev1.VolumeMount{ {Name: "data", MountPath: "/data", ReadOnly: true}, - {Name: "cache", MountPath: "/cache"}, + {Name: "cache", MountPath: cachePath}, }, }, }, @@ -115,7 +117,7 @@ func buildRestoreJob(cfg *config.Config, req api.RestoreTestRequest, jobName, se Resources: jobResources(cfg), VolumeMounts: []corev1.VolumeMount{ {Name: "restore", MountPath: "/restore"}, - {Name: "cache", MountPath: "/cache"}, + {Name: "cache", MountPath: cachePath}, }, }, }, @@ -258,7 +260,7 @@ func resticEnv(cfg *config.Config, secretName, repository string) []corev1.EnvVa } env := []corev1.EnvVar{ {Name: "RESTIC_REPOSITORY", Value: repository}, - {Name: "RESTIC_CACHE_DIR", Value: "/cache"}, + {Name: "RESTIC_CACHE_DIR", Value: cachePath}, { Name: "AWS_ACCESS_KEY_ID", ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: secretName}, Key: "AWS_ACCESS_KEY_ID"}},