From eca282126460f723570d9ee740768d7aece61a61 Mon Sep 17 00:00:00 2001 From: Jakob Edding <15202881+JakobEdding@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:59:54 +0200 Subject: [PATCH] Allow choosing the rclone command --- charts/rclone-copy/templates/rclone-cron.yaml | 11 +++++------ charts/rclone-copy/values.yaml | 5 ++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index e429e86..ae45c5e 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -58,7 +58,7 @@ spec: - name: rclone-container image: rclone/rclone:{{ .Values.imageRelease }} imagePullPolicy: {{ .Values.imagePullPolicy | quote }} - + command: - /bin/sh args: @@ -66,8 +66,8 @@ spec: # copy as workaround for rclone.conf read only (see https://github.com/rclone/rclone/issues/3655) - >- cp /root/.config/rclone/rclone_ro.conf /root/.config/rclone/rclone.conf && - rclone copy -v {{ .Values.arguments | join " " }} --include-from /root/include-pattern.conf "{{ .Values.sync.source.name }}:{{ .Values.sync.source.path }}" "{{ .Values.sync.dest.name }}:{{ .Values.sync.dest.path }}" - + rclone {{ .Values.command }} -v {{ .Values.arguments | join " " }} --include-from /root/include-pattern.conf "{{ .Values.sync.source.name }}:{{ .Values.sync.source.path }}" "{{ .Values.sync.dest.name }}:{{ .Values.sync.dest.path }}" + volumeMounts: - name: config # This is the default path where the rclone implementation assumes the config is located @@ -76,7 +76,7 @@ spec: - name: include-config mountPath: "/root/include-pattern.conf" subPath: "include-pattern.conf" - + resources: {{ toYaml .Values.resources | indent 14 }} @@ -97,7 +97,7 @@ spec: key: "{{ $value.key }}" {{- end }} {{- end }} - + restartPolicy: {{ .Values.restartPolicy }} volumes: - name: config @@ -107,4 +107,3 @@ spec: configMap: name: rclone-config-{{ .Release.Name }} backoffLimit: {{ .Values.backoffLimit }} - diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml index 2804680..5e59780 100644 --- a/charts/rclone-copy/values.yaml +++ b/charts/rclone-copy/values.yaml @@ -3,7 +3,7 @@ nameOverride: bakdata-rclone-copy # This is the cofiguration for the specific rclone-cronjob that you want to run. # `sync` contains the config for the source and destination of the rclone copy job. # It can be interpreted as: -# rclone copy {source.name}:{source.path} {dest.name}:{dest.path} +# rclone {command} {sync.source.name}:{sync.source.path} {sync.dest.name}:{sync.dest.path} sync: source: # This is the name for the source remote from the rclone.conf file. @@ -23,6 +23,9 @@ sync: # This is the path to the target directory. path: my-s3-bucket +# The rclone command to run. Default is "copy". +command: "copy" + # Additional arguments to pass to rclone. # The expected value is an array with comma seperated flag and value passed as a string. # Example: ["--transfers", '"1"']