yannh / kubeconform

A FAST Kubernetes manifests validator, with support for Custom Resources!
Apache License 2.0
2.16k stars 121 forks source link

kubeconform: not found on GitLab CI Pipeline #144

Closed gohayon closed 1 year ago

gohayon commented 1 year ago

Hi What am I missing? I'm trying to do a simple test by running the following pipeline:

stages:
  - validate

lint-kubeconform:
  stage: validate
  image:
    name: ghcr.io/yannh/kubeconform:latest-alpine
    entrypoint: [""]
  script:
    - kubeconform deployment.yaml
  only:
    - merge_requests

But I keep getting "/bin/sh: eval: line 141: kubeconform: not found" error :

    Running with gitlab-runner 15.4.0~beta.5.gdefc7017 (defc7017)
  on green-4.shared.runners-manager.gitlab.com/default ntHFEtyX
Resolving secrets
00:00
Preparing the "docker+machine" executor
00:09
Using Docker executor with image ghcr.io/yannh/kubeconform:latest-alpine ...
Pulling docker image ghcr.io/yannh/kubeconform:latest-alpine ...
Using docker image sha[2](https://gitlab.com/l1905/DevOps/test/lp-guy_demo_app_migration-app/-/jobs/3231153007#L2)56:d46[3](https://gitlab.com/l1905/DevOps/test/lp-guy_demo_app_migration-app/-/jobs/3231153007#L3)3e9ac3f6ee72a4b87c0aa4ee86f2551129c2d02139ec8596b8620710c965 for ghcr.io/yannh/kubeconform:latest-alpine with digest ghcr.io/yannh/kubeconform@sha256:ae1583859c7c9683b2f044a9cc911d9427030cd48ec33eeff6c0f23396780da9 ...
Preparing environment
00:01
Running on runner-nthfetyx-project-37525483-concurrent-0 via runner-nthfetyx-shared-1666794658-5c45583e...
Getting source from Git repository
00:01
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/l1905/DevOps/test/lp-guy_demo_app_migration-app/.git/
Created fresh repository.
Checking out f0f87510 as refs/merge-requests/4/head...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
Using docker image sha256:d4633e9ac3f6ee72a4b87c0aa4ee86f2551129c2d02139ec8596b8620710c965 for ghcr.io/yannh/kubeconform:latest-alpine with digest ghcr.io/yannh/kubeconform@sha256:ae1583859c7c9683b2f044a9cc911d9427030cd48ec33eeff6c0f23396780da9 ...
/bin/sh: eval: line 141: kubeconform: not found
$ kubeconform deployment.yaml
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit code 12[7](https://gitlab.com/l1905/DevOps/test/lp-guy_demo_app_migration-app/-/jobs/3231153007#L7)
Joe-Koch commented 1 year ago

Same problem here, what worked for me was updating the script to be - ~/../kubeconform deployment.yaml

gohayon commented 1 year ago

Perfect, @ZoeKoch. That did the trick. Thank you very much.......