Skip to content
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

Sync unable to work when file is changed #9590

Open
jefersoneiji opened this issue Nov 29, 2024 · 1 comment
Open

Sync unable to work when file is changed #9590

jefersoneiji opened this issue Nov 29, 2024 · 1 comment

Comments

@jefersoneiji
Copy link

Expected behavior

Image shoud be updated with new code after change in the original file.

Actual behavior

I get this error from skaffold

time="2024-11-29T08:12:57-03:00" level=debug msg="Running command: [kubectl --context docker-desktop exec posts-deploy-58c5697876-gx972 --namespace default -c posts -i -- tar xmf - -C / --no-same-owner]" subtask=-1 task=DevLoop
time="2024-11-29T08:12:57-03:00" level=warning msg="Skipping deploy due to sync error:copying files: running [kubectl --context docker-desktop exec posts-deploy-58c5697876-gx972 --namespace default -c posts -i -- tar xmf - -C / --no-same-owner]\n - stdout: \"\"\n - stderr: \"tar: Removing leading `/' from member names\\ntar: app/src/routes.ts: Cannot open: File exists\\ntar: Exiting with failure status due to previous errors\\ncommand terminated with exit code 2\\n\"\n - cause: exit status 2: sync failed for artifact \"blog/posts:df9fbc2741142307f50656f1cbce787da37b2df4467f3d5eaa3a03ea33a6a835\"" subtask=-1 task=DevLoop

Information

apiVersion: skaffold/v4beta11
kind: Config
metadata:
  name: blog
build:
  local: 
    push: false
  artifacts:
    - image: blog/client
      context: client
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.tsx" 
            dest: .
    - image: blog/comments
      context: comments
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.ts" 
            dest: .  
    - image: blog/event-bus
      context: event-bus
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.ts" 
            dest: .
    - image: blog/moderation
      context: moderation
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.ts" 
            dest: .
    - image: blog/posts
      context: posts
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.ts" 
            dest: .
    - image: blog/query
      context: query
      docker:
        dockerfile: Dockerfile
      sync: 
        manual:
          - src: "src/**/*.ts" 
            dest: .
manifests:
  rawYaml:
    - infra/k8s/client-deploy.yml
    - infra/k8s/comments-deploy.yml
    - infra/k8s/event-bus-deploy.yml
    - infra/k8s/ingress-service.yml
    - infra/k8s/moderation.deploy.yml
    - infra/k8s/posts-deploy.yml
    - infra/k8s/posts-service.yml
    - infra/k8s/query-deploy.yml

Steps to reproduce the behavior

  1. a clonable repository with the sample skaffold project
  2. skaffold dev
  3. make any change in the routes.ts in posts, query or comments folder
@jefersoneiji
Copy link
Author

I changed the sync field from this:

sync: 
   manual:
      - src: "src/**/*.ts" 
         dest: .

to this:

sync: 
    manual:
       - src: "src/***/*.ts" 
          dest: .

But the three stars in the glob pattern are supposed to mean nothing. Yet, skaffold was able to parse files after this change. My guess is that something is wrong with the parser or windows is causing this error during sync

maybe related to:
#4767
#1222 (comment)

@jefersoneiji jefersoneiji changed the title Sync unable to copy files into image Sync unable to work when file is changed Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant