firecow / gitlab-ci-local

Tired of pushing to test your .gitlab-ci.yml?
MIT License
2.17k stars 126 forks source link

CICD Component: inputs - invalid reference format #1297

Closed bataliero closed 1 month ago

bataliero commented 1 month ago

Component template.yml:

---
spec:
  inputs:
    image: 
      default: gcr.io/kaniko-project/executor
    tag: 
      default: v1.23.0
---
build:
  image:
    name: $[[ inputs.image ]]:$[[ inputs.tag ]]-debug
    entrypoint: [""]
  script: 
    - ls

and .gitlab-ci.yml

include:
  - local: "common/template.yml"

Error message

parsing and downloads finished in 89 ms.
json schema validated in 187 ms
build starting gcr.io/kaniko-project/executor:$[[ inputs.tag ]]-debug (test)
build copied to docker volumes in 1.23 s
Error: Command failed with exit code 1: docker pull gcr.io/kaniko-project/executor:$[[ inputs.tag ]]-debug
invalid reference format
    at makeError (/snapshot/firecow-gitlab-ci-local/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/snapshot/firecow-gitlab-ci-local/node_modules/execa/index.js:118:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at actualPull (/snapshot/firecow-gitlab-ci-local/src/job.ts:880:13)
    at Job.pullImage (/snapshot/firecow-gitlab-ci-local/src/job.ts:893:13)
    at Job.execScripts (/snapshot/firecow-gitlab-ci-local/src/job.ts:666:13)
    at Job.execPreScripts (/snapshot/firecow-gitlab-ci-local/src/job.ts:615:36)
    at Job.start (/snapshot/firecow-gitlab-ci-local/src/job.ts:512:9)
    at /snapshot/firecow-gitlab-ci-local/node_modules/p-map/index.js:57:22

It looks to me that inputs.tag in build starting gcr.io/kaniko-project/executor:$[[ inputs.tag ]]-debug (test) is not resolved to a string.

Host information Description: Ubuntu 22.04.3 LTS gitlab-ci-local 4.52.1

Containerd binary Docker version 26.1.4

PigeonF commented 1 month ago

I believe this is fixed in #1294