GoogleContainerTools / GoogleContainerTools/skaffold

Sync with manual mapping not working when multiple files are changed of which the first one is not mapped

Open
#9,326 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior
When two files are modified in one session and only the second is included in a manual sync mapping then a sync should be executed.

### Actual behavior
When two files are modified in one session and only the second is included in a manual sync mapping then no sync is being executed. If only the second file is modified then sync is executed. In other words, for any number of changed files if the first in the list does not match the pattern then no sync is being executed.

### Information

- Skaffold version: 2.10.1
- Operating system: Windows 10
- Installed via: Google Cloud code
- Contents of skaffold.yaml (excerpt):
```yaml
sync:
manual:
- src: "project-rest/target/classes/**/*.class"
dest: "/app/classes/"
strip: "project-rest/target/classes/"
```

When .java and .class files are modified (by changing the java file in IntelliJ and compiling):
```
files modified: [project-rest\src\main\java\package\WebController.java project-rest\target\classes\package\WebController.class]
files modified: [project-rest\src\main\java\package\WebController.java project-rest\target\classes\package\WebController.class]
Changed file project-rest\src\main\java\package\WebController.java does not match any sync pattern. Skipping sync
dev intents: build false, sync true, deploy false
```

When only the .class file is modified ((by changing the java file in IntelliJ, changing the window for IntelliJ to write the java file and then compiling):
```
files modified: [project-rest\target\classes\package\WebController.class]
files modified: [.idea\workspace.xml project-rest\target\classes\package\WebController.class]
dev intents: build false, sync true, deploy false

devloop: build false, sync true, deploy false

Syncing 1 files for localhost:5010/project-application:jbo_temp_20240220-9-gff455bb-dirty@sha256:0a3adc1d601c8097a7a4ea6665de500422afa7bb1807776a3e651a51fd8ee5c5
```

I'm working on a sample project to reproduce but I'm having issues with docker registry authentication.

This problem occurs with any number of modified files:
```
files modified: [project-application\target\classes\banner.txt project-application\target\classes\bootstrap.yml project-rest\target\classes\de\ppi\pcy\gen\rest\WebController.class]
files modified: [.idea\compiler.xml project-application\target\classes\banner.txt project-application\target\classes\bootstrap.yml project-common\target\test-classes\attachments\E2EID-1-dummy.pdf project-common\target\test-classes\attachments\E2EID-1-empty.pdf project-common\target\test-classes\attachments\E2EID-2-dummy.pdf project-common\target\test-classes\jsons\many-date-time-formats.json project-common\target\test-classes\jsons\many-with-errors.json project-common\target\test-classes\jsons\many.json project-common\target\test-classes\jsons\single-complete.json project-common\target\test-classes\jsons\single-minimal.json project-rest\src\main\java\de\ppi\pcy\gen\rest\WebController.java project-rest\target\classes\de\ppi\pcy\gen\rest\WebController.class]
Changed file project-application\target\classes\banner.txt does not match any sync pattern. Skipping sync
```
Only the first file is taken into account while any of the files matching the pattern should result in a sync.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.