GoogleContainerTools/skaffold

skaffold pre-build hook can't create input

开放

#7,216 创建于 2022年3月22日

 (7 条评论) (6 个反应) (0 位负责人)Go (1,416 个派生)batch import
area/hookshelp wantedkind/enhancementkind/starter-projectpriority/p3

仓库指标

星标
 (12,822 个星标)
PR 合并指标
 (平均合并 3天 6小时) (30 天内合并 16 个 PR)

描述

Expected behavior

My understanding of the before-build hook was that it should be able to create the inputs used for the build.

Actual behavior

Dependency checking happens before the before-build hook is run and fails as it can't find the data that hasn't been created yet.

Information

  • skaffold v1.35.2
  • Operating system: Ubuntu 18.04
  • Contents of skaffold.yaml:
apiVersion: skaffold/v2beta22
kind: Config
build:
  artifacts:
  - image: makedataimage
    hooks:
      before:
      - command: ["./makedata.sh"]

makedata.sh

#!/bin/bash

echo "XX" > data

Dockerfile

FROM busybox

COPY ./data .

Steps to reproduce the behavior

skaffold build

Generating tags...
 - makedataimage -> makedataimage:latest
Some taggers failed. Rerun with -vdebug for errors.
Checking cache...
 - makedataimage: Error checking cache.
getting hash for artifact "makedataimage": getting dependencies for "makedataimage": file pattern [./data] must match at least one file

贡献者指南