GoogleContainerTools/skaffold

Configuration dependencies don't resolve paths to deploy hooks

Open

#7,250 opened on Mar 31, 2022

View on GitHub
 (10 comments) (0 reactions) (0 assignees)Go (12,822 stars) (1,416 forks)batch import
area/hookshelp wantedkind/bugpriority/p3

Description

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

Contributor guide