skaffold: Skaffold v0.23.0 + Windows 10 regression: didn't sync any files

Expected behavior

Sync files when it changes

Actual behavior

Did not sync files. Always shows “didn’t sync any files”

Information

  • Skaffold version: v0.23.0
  • Operating system: Windows 10
  • Contents of skaffold.yaml:
Any yamls I tried

Steps to reproduce the behavior

  1. Update to v0.23.0 from v0.22.0
  2. Sync stops working

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 22 (9 by maintainers)

Most upvoted comments

Here’s a workaround that fixes Skaffold Sync at least for me.

Wrap skaffold dev in a script which

  • first resets the current namespace,
  • starts a subshell in the background that’ll switch back into the namespace you were,
  • and runs skaffold dev
_dev() {
  local current_ns; current_ns="$(kubectl config view --minify --output 'jsonpath={..namespace}')"
  kubectl config set-context --current --namespace=
  (sleep 3 && kubectl config set-context --current --namespace="${current_ns}" ) &
    
  skaffold dev
}

You may need to adjust sleep 3 for your environment.

This problem still exists in Skaffold 1.5.0.

Fyi @dgageot here’s the small repro that you asked for.

A workaround is to run skaffold dev with --trigger=polling

Same here, no syncing after the update. Here’s the console output (no error messages):

INFO[0048] files modified: [main.js]
Syncing 1 files for laander/myproject:a8db8a26762164d0d916ce0f7f29cd0db6388a5d74def8327003715c66daa368
INFO[0049] Copying files: map[main.js:main.js] to laander/myproject:a8db8a26762164d0d916ce0f7f29cd0db6388a5d74def8327003715c66daa368
DEBU[0049] Running command: [kubectl exec myproject-myproject-754cfb94cb-7cpqm --namespace default -c myproject -i -- tar xmf - -C / --no-same-owner]
Watching for changes every 1s...

Node.js app with nodemon refreshing upon file change

MacOS Mojave v10.14.3 Docker Desktop v2.0.2.0 Kubernetes v1.13.0

Nope: MacOs Mojave 10.14.3

everything running in the default namespace

Maybe this will be helpful:

Linux environment. I see that problem when my context namespace differ from a namespace defined for Helm chart, for example:

- context:
    cluster: minikube
    namespace: test
    user: minikube
  name: minikube
current-context: minikube

Case 1:

  • there is no namespace defined in skaffold.yaml,
  • there is test namespace defined in skaffold.yaml Result:
  • sync working as expected

Case 2:

  • there is namespace defined in Helm Chart with a different name then in context,
  • there is staging namespace defined in skaffold.yaml Result:
  • sync is not working at all

Where is a bug? Well, probably skaffold do not use proper namespace after deployment to communicate with the cluster?

Workaround: Always change context namespace to a namespace defined in skaffold.yaml or Helm chart before using skaffold.