【问题标题】:Facing error after running skaffold dev command运行 skaffold dev 命令后遇到错误
【发布时间】:2021-12-10 13:30:40
【问题描述】:

skaffold.yaml

apiVersion: skaffold/v2alpha3
kind: Config
deploy:
  kubectl:
    manifests:
      - ./infra/k8s/*
build:
  local:
    push: false
  artifacts:
    - image: karan346/auth
      context: auth
      docker:
        dockerfile: Dockerfile
      sync:
        manual:
          - src: 'src/**/*.ts'
            des: .

错误

parsing skaffold config: error parsing skaffold configuration file: unable to parse config: yaml: unmarshal errors:

line 10: field des not found in type v2alpha3.SyncRule

无法解决问题。一切都设置正确。

另外,有没有稳定的版本,以后不会报错?

【问题讨论】:

  • 你可以看到你的错误是关于字段des。您可以检查the documentation 并看到该字段名为dest。因此,一旦您更正它,它应该可以工作。至于apiVersion,最新的是skaffold/v2beta26——见here

标签: kubernetes skaffold


【解决方案1】:

您面临的错误是:

line 10: field des not found in type v2alpha3.SyncRule

这些apikind 中没有字段des

基于documentation for manual file sync,字段应命名为dest。请看下面的例子:

build:
  artifacts:
    - image: gcr.io/k8s-skaffold/node-example
      context: node
      sync:
        manual:
          # sync a single file into the `/etc` folder
          - src: '.filebaserc'
            dest: /etc

在发布答案时,skaffold 中的最后一个可用 apiVersionskaffold/v2beta26

总是可以在skaffold.yaml documentation上查看

【讨论】:

    猜你喜欢
    • 2021-07-16
    • 1970-01-01
    • 2020-05-02
    • 2020-10-15
    • 2021-09-02
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 2021-04-19
    相关资源
    最近更新 更多