kaniko/pkg/buildcontext
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
..
azureblob.go fix: credential typo 2020-03-12 14:31:15 +08:00
buildcontext.go feat: Add https tar.gz remote source for context (#1519) 2020-12-10 22:55:02 -08:00
dir.go Feature/contextsources (#195) 2018-07-06 06:24:50 -07:00
gcs.go ADD GCB benchmark code 2020-06-05 12:46:47 -07:00
git.go git: accept explicit commit hash for git context (#1765) 2021-10-19 19:27:15 -07:00
git_test.go fix: lint issues 2020-07-29 23:32:40 -03:00
https.go feat: Add https tar.gz remote source for context (#1519) 2020-12-10 22:55:02 -08:00
https_test.go feat: Add https tar.gz remote source for context (#1519) 2020-12-10 22:55:02 -08:00
s3.go Add support for S3 custom endpoint 2019-06-13 12:42:52 +09:00
tar.go feat: allow injecting through stdin tar.gz on kaniko 2020-03-18 12:29:49 +01:00
tar_test.go feat: add support of local '.tar.gz' file inside the kaniko container 2020-03-12 22:51:30 +01:00