devspace
devspace copied to clipboard
Locally deleted or renamed files are deleted from remote when included in uploadExcludePaths
What happened?
My sync
settings look like:
- imageName: webpack
disableDownload: false
localSubPath: services/webpack
initialSync: mirrorLocal
downloadExcludePaths:
- assets/images/
- assets/scripts/
- assets/stylesheets/
- node_modules/.cache/
uploadExcludePaths:
- node_modules/
- assets/markons/markons.*
- dist/
There's a bunch of files in assets/markons/
, looks like this:
services/webpack/assets/markons
├── markons-chars.json
├── markons.css
├── markons.eot
├── markons.html
├── markons.js
├── markons.svg
├── markons.ttf
├── markons.woff
└── markons.woff2
I want to use remote as the source of truth for all of them except markons-chars.json
for which local should be the source of truth.
I believe my upload/download exclude paths should accomplish that.
The weird part is if I delete markons.js
locally, then it will disappear from remote.
What did you expect to happen instead?
I would have expected uploadExcludePaths
also meant "don't delete from remote". Similarly, if I rename markons.js
-> markons.js.tmp
and back again, it's now gone from remote. I guess the first rename triggers a delete, and then the uploadExcludePaths
prevents the renamed file from appearing on remote, so it's just gone.
How can we reproduce the bug? (as minimally and precisely as possible)
Erm...hopefully above is descriptive enough? It's quite a large project.
Local Environment:
- DevSpace Version: devspace version 5.14.4
- Operating System: windows
- Deployment method: kubectl w/ kustomize
Kubernetes Cluster:
- Cloud Provider: For dev I'm using Docker Desktop
- Kubernetes Version:
❯ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"89182bdd065fbcaffefec691908a739d161efc03", GitTreeState:"clean", BuildDate:"2020-12-18T12:11:25Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.19", GitCommit:"ac0cc736d0018d817c763083945e4db863168d12", GitTreeState:"clean", BuildDate:"2021-05-12T11:21:54Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
Anything else we need to know?
That markons.js
file doesn't seem to be syncing properly in general when my remote build process rebuilds it. So I came up with the following command to force it to re-sync:
devspace sync --download-only --container webpack --no-watch --local-path services/webpack/assets/markons --container-path assets/markons --verbose
It took quite a few tries to get that command right, I would have thought a sync would respect all the paths specified in devspace.yaml
, not dump everything into my working directory. And I wasn't sure if --container-path
would be appended to the --local-path
or not. And then --verbose
could be a little more verbose actually, would be nice if it gave a summary like 1 file downloaded, 8 files skipped
. And a --dry-run
flag would be nice too; that would have helped me figure out what I was doing wrong before mucking up my local dir.
But anyway, I think I have to upload/download exclusions correct now so I'm going to keep an eye on that file to make sure it's syncing the way I want now, just the remote deletion quirk is weird/unexpected IMO.
Perhaps I should also mention:
autoReload:
paths:
- services/webpack/icons/**
What I'm doing is dropping my SVG icons in that directory, and then they get built into font files as part of the docker build step. So when I drop a new SVG in there locally, what I want to happen is autoReload
should trigger a full docker rebuild, and then it should sync those markons back down locally.
/kind bug
@mnpenner thanks for creating this issue! Yes seems like that shouldn't happen, we'll investigate and release a fix for this as soon as possible.
Regarding the devspace sync
issue: DevSpace will only respect your devspace.yaml
if you specify it explicitly with devspace sync --config devspace.yaml
, otherwise the devspace.yaml
has not effect at all