You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happened because of an edge case with a git binary version on a self-hosted runner.
When using tags of branch or sha on a directory that isn't a git repository, you get a complete error as an image name, e.g; eu.gcr.io/project/image:0.1-fatal: not a git repository (or any parent up to mount point /github) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).-fatal: not a git repository (or any parent up to mount point /github) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
This is an invalid image name, and kubernetes had some issues with this.
Expected Behaviour
Should fatal or exit back to the user (with a non zero exit code)
Current Behaviour
Creates invalid image names
Possible Solution
Exit with a non-zero exit code (so that a pipeline can exit too, in this case, the runner had checked the code out as a zip instead of git without any notice)
Steps to Reproduce (for bugs)
Run faas-cli build --parallel 5 --tag=sha -f faas-stack.yml on a non-git directory
Context
Runner had changed the checkout method without notification
The text was updated successfully, but these errors were encountered:
$ sudo faas-cli build --tag=sha
[sudo] password for mdekov:
Pulling template: perl-alpine from configuration file: stack.yml
Fetch templates from repository: https://github.com/tmiklas/openfaas-perl-templates at master
...
[0] > Building newnew.
Clearing temporary build folder: ./build/newnew/
Preparing: ./newnew/ build/newnew/function
Building: newnew:latest-fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). with go template. Please wait..
invalid argument "newnew:latest-fatal: not a git repository (or any parent up to mount point /)\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)." for "-t, --tag" flag: invalid reference format: repository name must be lowercase
See 'docker build --help'.
[0] < Building newnew done in 0.43s.
[0] Worker done.
Total build time: 0.43s
Errors received during build:
- [newnew] received non-zero exit code from build, error: invalid argument "newnew:latest-fatal: not a git repository (or any parent up to mount point /)\nStopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)." for "-t, --tag" flag: invalid reference format: repository name must be lowercase
See 'docker build --help'.
mdekov@mdekov-Lenovo-Y520-15IKBN:~/go/src/github.com/martindekov/newnew$ echo $?
1
@martindekov So I went back and took a look at our pipeline, turns out we built on one machine (with the correct git version) and deployed on one that ended up with the zip, looks like build does indeed fail correctly but deploy does not.
This happened because of an edge case with a git binary version on a self-hosted runner.
When using tags of branch or sha on a directory that isn't a git repository, you get a complete error as an image name, e.g;
eu.gcr.io/project/image:0.1-fatal: not a git repository (or any parent up to mount point /github) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).-fatal: not a git repository (or any parent up to mount point /github) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
This is an invalid image name, and kubernetes had some issues with this.
Expected Behaviour
Should fatal or exit back to the user (with a non zero exit code)
Current Behaviour
Creates invalid image names
Possible Solution
Exit with a non-zero exit code (so that a pipeline can exit too, in this case, the runner had checked the code out as a zip instead of git without any notice)
Steps to Reproduce (for bugs)
faas-cli build --parallel 5 --tag=sha -f faas-stack.yml
on a non-git directoryContext
Runner had changed the checkout method without notification
The text was updated successfully, but these errors were encountered: