Skip to content

Commit cc937db

Browse files
authored
Merge pull request #192 from covexo/test-sync
Test sync
2 parents 2389f87 + fae6b3c commit cc937db

7 files changed

Lines changed: 771 additions & 253 deletions

File tree

Gopkg.lock

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/devspace/sync/downstream.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (d *downstream) downloadFiles(files []*fileInformation) (string, error) {
216216

217217
// Each file is represented in one line
218218
for _, element := range files {
219-
if lenFiles <= 3 {
219+
if lenFiles <= 3 || d.config.verbose {
220220
d.config.Logf("[Downstream] Download file %s, size: %d", element.Name, element.Size)
221221
}
222222

@@ -335,7 +335,7 @@ func (d *downstream) removeFilesAndFolders(removeFiles map[string]*fileInformati
335335
absFilepath := filepath.Join(d.config.WatchPath, key)
336336

337337
if shouldRemoveLocal(absFilepath, value, d.config) {
338-
if numRemoveFiles <= 3 {
338+
if numRemoveFiles <= 3 || d.config.verbose {
339339
d.config.Logf("[Downstream] Remove %s", key)
340340
}
341341

@@ -369,7 +369,7 @@ func (d *downstream) createFolders(createFolders []*fileInformation) {
369369

370370
for _, element := range createFolders {
371371
if element.IsDirectory {
372-
if numCreateFolders <= 3 {
372+
if numCreateFolders <= 3 || d.config.verbose {
373373
d.config.Logln("[Downstream] Create folder: " + element.Name)
374374
}
375375

pkg/devspace/sync/sync_config.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,16 @@ type SyncConfig struct {
5050
upstream *upstream
5151
downstream *downstream
5252

53-
silent bool
53+
silent bool
54+
verbose bool
55+
5456
stopOnce sync.Once
5557
stopped bool
5658

5759
// Used for testing
5860
testing bool
5961
errorChan chan error
62+
readyChan chan bool
6063
}
6164

6265
// Logf prints the given information to the synclog with context data
@@ -76,7 +79,11 @@ func (s *SyncConfig) Logln(line interface{}) {
7679
if s.Pod != nil {
7780
syncLog.WithKey("pod", s.Pod.Name).WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Info(line)
7881
} else {
79-
syncLog.WithKey("local", s.WatchPath).WithKey("container", s.DestPath).Info(line)
82+
syncLog.
83+
WithKey("local",
84+
s.WatchPath).
85+
WithKey("container", s.DestPath).
86+
Info(line)
8087
}
8188
}
8289
}
@@ -224,6 +231,10 @@ func (s *SyncConfig) startUpstream() {
224231

225232
defer notify.Stop(s.upstream.events)
226233

234+
if s.readyChan != nil {
235+
s.readyChan <- true
236+
}
237+
227238
err = s.upstream.mainLoop()
228239
if err != nil {
229240
s.Error(err)

0 commit comments

Comments
 (0)