kaniko/pkg
wwade 82fc94d930
git: accept explicit commit hash for git context (#1765)
* git: accept explicit commit hash for git context

When checking out code from non-github repositories, the typical
assumptions may not be valid, e.g. that the only interesting
non-branch commits have ref names starting with refs/pull. A specific
example is fetching an un-merged commit from a gerrit repository by
commit hash.

This change just looks at the second part of the git context path and
checks if it's a SHA commit hash, and if so, will fetch and check out
this commit after cloning the repository.

Sample context argument:

    https://github.repo/project#e1772f228e06d15facdf175e5385e265b57068c0

* ci: fix test script to recognize any non-zero exit as an error

hack/linter.sh didn't properly install golangci-lint in hack/bin as I
already have another version of golangci-lint on my PATH, but then it
failed to execute because it was looking for it specifically in
hack/bin.

When the executable is not found, the exit code is 127 instead of 1,
and so test.sh ignored the error.

Two fixes:

1. `test.sh`:
  - Use `if (script) ...` instead of assigning / checking a result
    variable to determine if each validation script passed or failed.

2. `hack/linter.sh`:
  - Instead of checking for golangci-lint on the path, just
    specifically check for an executable file (`test -x`) in the
    expected location.

Co-authored-by: Wade Carpenter <wwade@users.noreply.github.com>
2021-10-19 19:27:15 -07:00
..
buildcontext git: accept explicit commit hash for git context (#1765) 2021-10-19 19:27:15 -07:00
cache Try to warm all images and warn about errors (#1653) 2021-06-04 10:07:57 -07:00
commands Fix composite cache key for multi-stage copy command (#1735) 2021-10-18 23:31:01 -07:00
config Remove tarball.WithCompressedCaching flag to resolve OOM Killed error (#1722) 2021-10-19 00:14:06 -07:00
constants Revert "save snaphots to tmp dir (#1662)" (#1670) 2021-06-14 12:09:07 -07:00
creds Update ggcr to pick up estargz and caching option (#1527) 2020-12-21 10:09:21 -08:00
dockerfile Merge pull request #1260 from ljakimczuk/master 2020-06-04 13:24:34 -07:00
executor Run docker_credentials_gcr in warmer (#1780) 2021-10-19 12:25:42 -07:00
fakes refactor cache.Warm and add tests 2020-01-10 12:29:17 -08:00
filesystem Fix snapshotter ignore list; do not attempt to delete whiteouts of ignored paths (#1652) 2021-06-04 10:07:24 -07:00
image Support mirror registries with path component (#1707) 2021-08-10 22:06:51 -07:00
logging Add timestamp to logs 2020-04-23 13:40:47 +02:00
mocks/go-containerregistry/mockv1 rename mock pkg for lint 2020-01-17 14:59:14 -08:00
snapshot chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00
timing Add a lot more timing data. (#518) 2019-01-10 13:27:55 -07:00
util Run docker_credentials_gcr in warmer (#1780) 2021-10-19 12:25:42 -07:00
version Set a user-agent for registry pushes. (#87) 2018-04-13 14:25:58 -07:00