Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob path matching causes panic #242

Open
sqsp-rwatkins opened this issue Mar 15, 2023 · 0 comments
Open

Glob path matching causes panic #242

sqsp-rwatkins opened this issue Mar 15, 2023 · 0 comments

Comments

@sqsp-rwatkins
Copy link

sqsp-rwatkins commented Mar 15, 2023

Describe the bug
Using 2 or more glob paths for the mount paths causes a panic

To Reproduce
Steps to reproduce the behavior:

  1. Using the following config in drone:
image: meltwater/drone-cache
settings:
  backend: gcs
  cache_key: [REDACTED]/{{ checksum "yarn.lock" }}
  json_key: [REDACTED]
  bucket: [REDACTED]
  region: [REDACTED]
  mount:
    - "packages/**/node_modules"
    - "node_modules"
    - "plugins/**/node_modules"
  1. See Drone console output for error

Expected behavior
Expected glob paths to work as described and implemented in #209

Drone console output

panic: runtime error: index out of range [2] with length 2

goroutine 1 [running]:
github.com/meltwater/drone-cache/internal/plugin.(*Config).HandleMount(0xc0006bf740, {0x142da80, 0xc00011f090})
	/home/runner/work/drone-cache/drone-cache/internal/plugin/config.go:56 +0x345
github.com/meltwater/drone-cache/internal/plugin.(*Plugin).Exec(0xc0006bf5d8)
	/home/runner/work/drone-cache/drone-cache/internal/plugin/plugin.go:134 +0xebc
main.run(0xc0001f9500?)
	/home/runner/work/drone-cache/drone-cache/main.go:613 +0x1706
github.com/urfave/cli/v2.(*App).RunContext(0xc000434700, {0x1433a70?, 0xc00013c030}, {0xc00011e1e0, 0x1, 0x1})
	/home/runner/work/drone-cache/drone-cache/vendor/github.com/urfave/cli/v2/app.go:392 +0xf3f
github.com/urfave/cli/v2.(*App).Run(...)
	/home/runner/work/drone-cache/drone-cache/vendor/github.com/urfave/cli/v2/app.go:253
main.main()
	/home/runner/work/drone-cache/drone-cache/main.go:493 +0x423a

Desktop (please complete the following information):
N/A running in drone using meltwater/drone-cache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant