-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature Request: expanded glob support for sync #1222
Comments
The sync feature should respect the same exact syntax as the Dockerfile I think. We already parse the dockerfile COPY and ADD glob patterns in https://github.com/GoogleContainerTools/skaffold/blob/master/pkg/skaffold/docker/parse.go#L213-L257 I'm pretty sure applying that code to the sync patterns should work. Somewhere along the lines util.ExpandPathsGlob was used there, but we should have one central glob matcher (for kubectl manifest list, sync list, and Dockerfile COPY/ADD parsing) |
That would give us https://docs.docker.com/engine/reference/builder/#copy style matching. |
According to your linked docs, that's also only filepath.Match. I've currently got ten subdirectories in my source directory, so to synchronize both .ts & .tsx from those 10 and the root I'd need 22 rules, afaict. #1161 is limiting my testing of that. That's not a huge deal, but if anybody creates a new directory and forgets to add that to skaffold.yaml, they might be confused for a while... |
This might be a slightly different approach to it, but I think it's the only feasible approach for deeply nested projects. What do you think? #1266 |
@r2d4 can you elaborate why is this? |
Fixed by #1266 |
I believe the cause of this is this function: skaffold/pkg/skaffold/sync/sync.go Lines 178 to 189 in 0bd43a4
Notice how it returns only one
|
For anyone else strugling with this issue, this work around (syncing all the things) works for me:
|
Hey @jsdevtom I wasn't able to reproduce this bug, could you provide the repo you're using, or a sample repo? For me, multiple triple star patterns are working as expected, and from the code it looks like multiple triple star patterns can be added to the map. |
@priyawadhwa This is definitely reproducible on a project I am working on (but am not willing to share). But when I try it with the react-reload example project, I am unable to reproduce, I will see if I can narrow the problem down on the project I am working on. |
please feel free to close until I am able to reproduce |
AFAICT, the cool new sync feature uses path/filepath#Glob for it's globbing. That function is very limited: no support for matching the separator (aka recursive matching), no support for 0 or 1 matches, et cetera. Would it be possible to use a more featureful globbing package?
The text was updated successfully, but these errors were encountered: