Skip to content

Commit

Permalink
Allow choosing the rclone command
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobEdding committed Aug 29, 2024
1 parent be09925 commit eca2821
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 5 additions & 6 deletions charts/rclone-copy/templates/rclone-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ spec:
- name: rclone-container
image: rclone/rclone:{{ .Values.imageRelease }}
imagePullPolicy: {{ .Values.imagePullPolicy | quote }}

command:
- /bin/sh
args:
- -c
# 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
Expand All @@ -76,7 +76,7 @@ spec:
- name: include-config
mountPath: "/root/include-pattern.conf"
subPath: "include-pattern.conf"

resources:
{{ toYaml .Values.resources | indent 14 }}

Expand All @@ -97,7 +97,7 @@ spec:
key: "{{ $value.key }}"
{{- end }}
{{- end }}

restartPolicy: {{ .Values.restartPolicy }}
volumes:
- name: config
Expand All @@ -107,4 +107,3 @@ spec:
configMap:
name: rclone-config-{{ .Release.Name }}
backoffLimit: {{ .Values.backoffLimit }}

5 changes: 4 additions & 1 deletion charts/rclone-copy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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"']
Expand Down

0 comments on commit eca2821

Please sign in to comment.