Rewrite remoteload_test integration tests (#4783)

* Better error message when git clone fails

* support file:// URLs

* rewrite remoteload_test

* lint and test fix

* fixes for kverey's comments

* document file:// remote load

* replace assert with require where appropriate

* add tests for file:// without git suffix

* fixes plus pr review from natasha

* fixes for review, lint

* revert changes to error handling

* fix skipped test
This commit is contained in:
Yunchi Luo
2022-09-19 12:13:18 -04:00
committed by GitHub
parent d6e40a3f6c
commit e62480d11c
16 changed files with 633 additions and 450 deletions

View File

@@ -12,6 +12,7 @@ following query string parameters can also be specified:
* `ref` - a [`git fetch`-able ref](https://git-scm.com/docs/git-fetch), typically a branch, tag, or full commit hash
(short hashes are not supported)
* `version` - same as `ref`. If `ref` is provided, this is ignored.
* `timeout` (default `27s`) - a number in seconds, or a go duration. specifies
the timeout for fetching the resource
* `submodules` (default `true`) - a boolean specifying whether to clone
@@ -25,7 +26,14 @@ will essentially clone the git repo via HTTPS, checkout `v1.0.6` and run
SSH clones are also supported either with `git@github.com:owner/repo` or
`ssh://git@github.com/owner/repo` URLs.
`file:///` clones are not supported.
`file:///` clones are supported. For
example, `file:///path/to/repo//someSubdir?ref=v1.0.6`, references the absolute
path to the repo at `/path/to/repo`, and a kustomization directory
at `someSubdir` within that repo. `//` to delimits the root of the repo.
Kustomize will clone the repo to a temporary directory and do a clean checkout
of the `ref`. This behavior is differs from a direct path reference
like `/path/to/repo/someSubdir`, in which case Kustomize will not use Git at
all, and process the files at the path directly.
## remote files
Resources can reference remote files via their raw GitHub urls, such