kaniko/integration
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
..
benchmark_fs minimal changes 2020-06-06 00:16:14 -07:00
context Fixes a whitelist issue when untarring files in ADD commands. (#371) 2018-09-28 11:42:07 -07:00
dockerfiles chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00
dockerfiles-with-context Add support to --chown flag to ADD command 2020-03-14 16:24:40 +02:00
ignore Re-add support for .dockerignore file 2018-12-10 15:20:25 -08:00
ignore_relative Fix #776 2019-10-03 17:53:14 +02:00
testdata Exit Code Propagation (#1655) 2021-06-01 10:43:49 -07:00
.dockerignore Re-add support for .dockerignore file 2018-12-10 15:20:25 -08:00
BUILD Update ggcr to pick up estargz and caching option (#1527) 2020-12-21 10:09:21 -08:00
benchmark_test.go minimal changes 2020-06-06 00:16:14 -07:00
cleanup.go Pass bucket and repo as args to tests 2018-07-31 09:53:59 -07:00
cmd.go Deflake the daemon test (#532) 2019-01-17 15:30:08 -05:00
config.go Allow contributors to launch integration tests against local registry 2020-02-06 13:35:51 +01:00
gcs.go Actually fix the paths for benchmark uploading during integration test runs. (#543) 2019-01-28 12:52:27 -06:00
images.go chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00
integration_test.go git: accept explicit commit hash for git context (#1765) 2021-10-19 19:27:15 -07:00
integration_with_context_test.go add integration tests with their own context 2020-02-29 15:41:10 -08:00
integration_with_stdin_test.go feat: allow injecting through stdin tar.gz on kaniko 2020-03-18 12:29:49 +01:00
k8s-job.yaml chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00
k8s_test.go chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00
tar.tar chore: add workflows for pr tests (#1766) 2021-10-18 23:22:44 -07:00