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

Skaffold sync unable to parse config #2158

Closed
Hudsonzp opened this issue May 21, 2019 · 8 comments
Closed

Skaffold sync unable to parse config #2158

Hudsonzp opened this issue May 21, 2019 · 8 comments
Labels
area/sync kind/bug Something isn't working

Comments

@Hudsonzp
Copy link

Hudsonzp commented May 21, 2019

Expected behavior

Yaml file parses correctly and directory syncing works.

Actual behavior

Parse error on the latest version. No more directory sync.

Information

A little while ago I approached skaffold with an issue syncing entire directories. I was instructed to use an undocumented pattern ***/*.js. That worked, but it appears that pattern has been removed on the latest version so I'm looking for a solution to be able to do that again?

  • Skaffold version: Version 0.29 (latest as of May 20).
  • Operating system: macOS Mojave 10.14.4
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta10
kind: Config
build:
  local:
    push: false
  artifacts:
    - image: test/dev-client
      docker:
        dockerfile: Dockerfile.dev
      context: ./client
      sync:
        '***/*.css': .
        '***/*.scss': .
        '***/*.js': .
        '***/*.less': .
    - image: test/dev-server
      docker:
        dockerfile: Dockerfile.dev
      context: ./server
      sync:
        '***/*.py': .

deploy:
  kubectl:
    manifests:
      - k8s-dev/client-deployment.yaml
      - k8s-dev/server-deployment.yaml

Steps to reproduce the behavior

  1. Use the undocumented *** star pattern above.
  2. Try to run skaffold dev
FATA[0000] creating runner: parsing skaffold config: unable to parse config: yaml: unmarshal errors:
  line 12: field ***/*.css not found in type latest.Sync
  line 13: field ***/*.scss not found in type latest.Sync
  line 14: field ***/*.js not found in type latest.Sync
  line 15: field ***/*.less not found in type latest.Sync
  line 21: field ***/*.py not found in type latest.Sync
@corneliusweig
Copy link
Contributor

The sync config was improved with version v1beta10. The easiest fix is to change your config version to v1beta9 and call skaffold fix. Skaffold will update your sync config for you.

@Hudsonzp
Copy link
Author

@corneliusweig thank you! Very help and solved my issue.

@Hudsonzp
Copy link
Author

@corneliusweig

So this is the proper approach now for the triple star?

 manual:
          - src: '**/*.css'
            dest: .
          - src: '**/*.scss'
            dest: .
          - src: '**/*.js'
            dest: .
          - src: '**/*.less'
            dest: .
      docker:

Just checking that "dest" is meant to be empty?

@Hudsonzp Hudsonzp reopened this May 22, 2019
@corneliusweig
Copy link
Contributor

corneliusweig commented May 22, 2019

Yes this is correct. Please see https://skaffold.dev/docs/how-tos/filesync/ for details.

@dgageot dgageot added area/sync kind/bug Something isn't working labels May 27, 2019
@Hudsonzp
Copy link
Author

Hudsonzp commented May 28, 2019

@corneliusweig thanks for the info and link.

I've noticed now that I'm back to the problem I had previously when files get flattened ever since making this change.

However, the current filesync documentation found here doesn't show anything about preserving that file structure that the triple asterisk used to accomplish. https://skaffold.dev/docs/how-tos/filesync/

Any thoughts on how I can get this back in there?

@Hudsonzp
Copy link
Author

I updated my skaffold version to v1beta11 and it seems to be working better now...tough to confirm though. On v1beta10 this was definitely an issue though.

@corneliusweig
Copy link
Contributor

The directory structure will always be preserved. Flattening is completely gone.

Are you still experiencing an issue with sync or does everything work as expected? I lost track of what you are trying to accomplish.

@Hudsonzp
Copy link
Author

@corneliusweig seems to be working a little more fluidly today. Perhaps there was something going on with my cache or I didn't have something setup properly. Will continue to watch it, but we can consider this closed for now!

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants