GoogleContainerTools/skaffold

Configuration dependencies don't resolve paths to deploy hooks

Open

#7,250 创建于 2022年3月31日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)Go (12,822 star) (1,416 fork)batch import
area/hookshelp wantedkind/bugpriority/p3

描述

Expected behavior

When having a toplevel configution like this:

apiVersion: skaffold/v2beta25
kind: Config
requires:
  - configs: ["cfg1"]
    path: cfg1/skaffold.yaml
  - configs: ["cfg2"]
    path: cfg2/skaffold.yaml

When the skaffold.yaml files in ./cfg1 and ./cfg2 define deploy hooks, the paths to these hooks should resolved relative to the ./cfg1, or ./cfg2 directory. For instance if ./cfg2 has:

deploy:
  kubectl:
    manifests:
    - deploy/kubernetes.yaml
    hooks:
      before:
        - host:
            command: ["sh", "-c", "deploy/skaffold-before-hook.sh"]

it should look for skaffold-before-hook.sh in ./cfg2/deploy/ and not in ./deploy. Also, any files that are created or referenced by this hook should be relative to ./cfg2

Actual behavior

hooks are resolved relative to the toplevel directory. I have to make a symlink ./deploy/skaffold-before-hook.sh --> ../cfg2/deploy/skaffold-before-hook.sh

Information

  • Skaffold version: 1.37.0
  • Operating system: Linux Ubuntu 20.04
  • Installed via: skaffold.dev

贡献者指南