diff --git a/charts/rclone-copy/templates/_helpers.tpl b/charts/rclone-copy/templates/_helpers.tpl index 4028b9c..8d6393a 100644 --- a/charts/rclone-copy/templates/_helpers.tpl +++ b/charts/rclone-copy/templates/_helpers.tpl @@ -27,3 +27,11 @@ Create chart name and version as used by the chart label. {{- define "rclone-copy.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{- define "rclone-copy.getSourceOrUrl" -}} +{{- if .Values.sync.url -}} +{{ .Values.sync.url -}} +{{- else -}} +{{ .Values.sync.source.name }}:{{ .Values.sync.source.path -}} +{{- end -}} +{{- end -}} diff --git a/charts/rclone-copy/templates/rclone-cron.yaml b/charts/rclone-copy/templates/rclone-cron.yaml index ae45c5e..f546594 100644 --- a/charts/rclone-copy/templates/rclone-cron.yaml +++ b/charts/rclone-copy/templates/rclone-cron.yaml @@ -66,7 +66,7 @@ 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 {{ .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 }}" + rclone {{ .Values.command }} -v {{ .Values.arguments | join " " }} --include-from /root/include-pattern.conf "{{ include "rclone-copy.getSourceOrUrl" . }}" "{{ .Values.sync.dest.name }}:{{ .Values.sync.dest.path }}" volumeMounts: - name: config diff --git a/charts/rclone-copy/values.yaml b/charts/rclone-copy/values.yaml index 5e59780..b27eaf3 100644 --- a/charts/rclone-copy/values.yaml +++ b/charts/rclone-copy/values.yaml @@ -14,6 +14,9 @@ sync: # This is the path to the source directory. path: /tmp/sync-dir + # Alternatively for the case of `rclone copyurl`, provide a URL instead of a source + url: https://example.com/myFileDownload + dest: # This is the name for the destination remote from the rclone.conf file. # If the value specified here is not present in the config file, the job will fail.