drone-plugins / drone-s3-cache

Caches build artifacts to S3 compatible storage backends
http://plugins.drone.io/drone-plugins/drone-s3-cache
Apache License 2.0
29 stars 30 forks source link

path and fallback_path doesn't work with AWS S3 #58

Open Upgreydd opened 4 years ago

Upgreydd commented 4 years ago

Hi. When I define path and fallback_path, then fallback_path is never used, even if path doesn't exist.

tboerger commented 4 years ago

And how have you tested that this is the case?

Upgreydd commented 4 years ago

And how have you tested that this is the case?

I've set path to non existent key and fallback_path to existing one. In case if path doesn't exist fallback_path is not used.

latest: Pulling from plugins/s3-cache
Digest: sha256:ca1a6814a9d1d4ec3851dd4642e52e4535302325c51ea5153a6620e459978e8b
Status: Image is up to date for plugins/s3-cache:latest
time="2020-06-26T15:14:18Z" level=info msg="No fallback_path specified. Creating default"
time="2020-06-26T15:14:18Z" level=info msg="No flush_path specified. Creating default"
time="2020-06-26T15:14:18Z" level=info msg="No filename specified. Creating default"
time="2020-06-26T15:14:18Z" level=info msg="Restoring cache at /some/path/archive.tar"
time="2020-06-26T15:14:18Z" level=info msg="Retrieving file in some at path/archive.tar"
time="2020-06-26T15:14:18Z" level=info msg="Cache restored"

in this case path is set to /some/path which doesn't exist in bucket. Default fallback_path is not used as you can see.

task definition is:

- name: Restore cache
  image: plugins/s3-cache
  settings:
    debug: true
    pull: true
    restore: true
    path: /some/path
Upgreydd commented 4 years ago

@tboerger any idea why it happens?

tboerger commented 3 years ago

Log said you haven't defined a fallback path. Please provide a full example which doesn't work.

time="2020-06-26T15:14:18Z" level=info msg="No fallback_path specified. Creating default"

Upgreydd commented 3 years ago

Log said you haven't defined a fallback path. Please provide a full example which doesn't work.

time="2020-06-26T15:14:18Z" level=info msg="No fallback_path specified. Creating default"

Why do I need passing fallback_path? Default should be used which is fine for me.