Commit Graph

56 Commits

Author SHA1 Message Date
Katrina Verey
8b21844b10 Do not use filepath.Separator for splitting URLs 2023-01-24 18:10:34 -05:00
Anna Song
298b87a223 Fix master
Fix RepoSpec build errors as result of merging 2 RepoSpec PRs in parallel
2023-01-23 13:21:55 -08:00
Kubernetes Prow Robot
a69092c4b7 Merge pull request #4986 from KnVerey/repospec_custom_usernames
repospec: support ssh urls with ssh certificates
2023-01-20 13:23:54 -08:00
Katrina Verey
2405da65d2 repospec: support ssh urls with ssh certificates 2023-01-17 23:25:07 -05:00
Katrina Verey
7e000aa820 Remove manipulation of .git suffix, which is just a conventional part of the directory name 2023-01-17 23:04:16 -05:00
Katrina Verey
00208394d6 Refactor parseGitURL to consolidate code paths, improve error handling 2023-01-16 20:36:19 -05:00
Cailyn
8ab4b8d167 remove direct dependency on github/pkg/errors (#4970) 2023-01-13 10:52:25 -08:00
Katrina Verey
3134e9b0c2 Better SCP colon-must-be-after-slash test 2023-01-10 16:14:54 -05:00
Katrina Verey
c2885642d6 Remove unused param 2023-01-10 15:01:29 -05:00
Katrina Verey
a885ee12c6 Add test for behaviour of scp-like non-github that incorrectly uses slash 2023-01-09 17:32:29 -05:00
Katrina Verey
1a201ab913 do not validate against http+usernames after all 2023-01-09 17:25:10 -05:00
Katrina Verey
240282fc6f Allow file paths that look like usernames 2023-01-09 17:15:40 -05:00
Katrina Verey
ddf14ea688 Deprecate git:: stripping 2023-01-09 13:18:11 -05:00
Katrina Verey
64d2366e87 Naming changes from rebase 2023-01-09 13:15:26 -05:00
Katrina Verey
06999462e7 Make Github less special 2023-01-09 13:13:28 -05:00
Katrina Verey
2591303430 Add test case from github docs 2023-01-09 13:13:28 -05:00
Katrina Verey
150134758f Show change vs master on accepted but invalid ssh-like urls 2023-01-09 13:13:28 -05:00
Katrina Verey
43d96ba91b Address feedback on correctness of SCP/username validations 2023-01-09 13:13:28 -05:00
Katrina Verey
4821259f01 Stop handling mysterious gh: prefix in remote URLs 2023-01-09 13:13:27 -05:00
Katrina Verey
7e6cc7aafb Review feedback 2023-01-09 13:13:27 -05:00
Katrina Verey
dc05fa153f Additional repospec refactoring 2023-01-09 13:13:27 -05:00
Anna Song
fbb94584dc Refactor parseHostSpec
Fix ssh parsing in issue 4847
2023-01-09 13:13:25 -05:00
Kishore Jagannath
772fafa892 Rename Orgrepo and Path (#4922)
* initial changes to rename OrgRepo to RepoPath

* changes to rename Path to KustRootPath

* addressed review comments

* addressed review comments

* docs: Add documentation for namespace transformer

Add a short description of the namespace transformer and example
usage to examples/transformerconfigs/README.md.

References: #629
Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>

* Localize patchesJson6902, patchesStrategicMerge, replacements (#4904)

* Localize patchesJson6902, patchesStrategicMerge, replacements

* Address code review feedback

* Improve readability
* Remove deprecation warning check

* Load legacy kustomization fields for `localize` (#4918)

* Load legacy kustomization

* Expose loadKustFile in kusttarget

* remove FixKustomizationPreUnmarshalling

* remove deprecated cfg and fn commands (#4930)

* remove deprecated cfg and fn commands

* fix lint error

* run gofmt

* Localize PatchTransformer, PatchJson6902Transformer (#4920)

* Localize patches, patchesJson6902 custom transformers

* Improve readability

* Localize fields: openapi, configurations, crds (#4907)

* Localize openapi, configurations, crds

* Add integration test

* Move krusty test

* Address code review feedback

* Implement locRootPath (#4909)

* Implement locRootPath, and include userinfo, port in locFilePath

* Strip userinfo, port

* Improve readability

* Localize legacy fields

* Localize resources (#4912)

* Localize resources

* Improve readability

* Add integration tests

* Group test helper functions

* Remove Functionality that Pulls Env Variables from Empty Keys

* Update api/kv/kv.go

Co-authored-by: Katrina Verey <kn.verey@gmail.com>

* refactor Unmarshal Kustomization struct code

* improve error messages

* Run go mod tidy on all modules before update

* Update sigs.k8s.io/yaml to 1.3.0

* fixed test failure because of latest commits

Signed-off-by: Lars Kellogg-Stedman <lars@oddbit.com>
Co-authored-by: Lars Kellogg-Stedman <lars@oddbit.com>
Co-authored-by: Anna Song <annasong@google.com>
Co-authored-by: yugo kobayashi <kobdotsh@gmail.com>
Co-authored-by: Natasha Sarkar <natashasarkar@google.com>
Co-authored-by: Cailyn Edwards <cailyn.edwards@shopify.com>
Co-authored-by: Cailyn <cailyn.s.e@gmail.com>
Co-authored-by: Katrina Verey <kn.verey@gmail.com>
Co-authored-by: Katrina Verey <katrina.verey@shopify.com>
2023-01-09 08:45:29 -08:00
Kishore Jagannath
1e2e7bbc0b Refactor 7 return values in parseGitUrl to RepoSpec(issue 4866, Task1) (#4900)
* initial commit to refactor 7 return values in parseGitUrl to RepoSpec

* fix review comments
2022-12-02 10:01:53 -08:00
Anna Song
07063a2652 Prevent repoSpec path from exiting repo 2022-11-23 14:29:22 -08:00
Anna Song
84bd402cc0 Fix RepoSpec query extraction (#4863)
* Clean query processing

* Improve readability

* Remove redundant code
* Add comment

* Return path literal when not parsable

* Handle url.Parse() error in future
2022-11-14 09:38:41 -08:00
Yunchi Luo
e62480d11c 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
2022-09-19 09:13:18 -07:00
Kubernetes Prow Robot
cb2636335f Merge pull request #4779 from annasong20/locloader
Reinstate #4652 without url-related code
2022-08-30 08:13:01 -07:00
Anna Song
f80cf9f433 Reinstate #4652 without url-related code
Remove code that changes remotes-loading code path, as mandated by #4756
2022-08-29 16:57:15 +00:00
Yunchi Luo
d917876949 expand and clean up repospec_test 2022-08-27 14:30:10 -04:00
Natasha Sarkar
8868d91670 Revert "Load and calculate Destination of files for kustomize localize (#4652)"
This reverts commit bf17fe1d8f.
2022-08-26 13:26:23 -05:00
Anna Song
bf17fe1d8f Load and calculate Destination of files for kustomize localize (#4652)
* Implement file localization for localize

Implement file localization for new command kustomize localize

* Patch file localization

Fix lint errors, address feedback, begin transition to file loader from
localizer

* Add Repo() to Loader

* Implement locLoader factory + cleanup

* Add domain to RepoSpec

Fix ssh relative url host parsing for non-github domain on the side

* Implement Load(), New(), Root(), Dst() for LocLoader

* Address repospec code review comments

* Address 1st round of code review feedback

* Address feedback #2

Removed localized path calculations to cover edge case and improve readability.

* Remove ldr Cleanup logging

* Address code review round #3

* Address code review feedback #4
2022-08-19 14:33:53 -07:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Haibing Zhou
8c14b9d1af api/internal/git: handle .git suffix in repospec
This change adds a new test case for parsing url with `.git` suffix. In
that case, we should have the full url as clone spec with an empty
abspath.
2021-07-05 13:10:35 -07:00
Jeff Regan
936ac37a2e Update repospec_test.go 2021-06-21 14:30:11 -07:00
Francesc Campoy
7fae7d1bd6 Move api/filesys to kyaml/filesys (#3997)
* Move api/filesys to kyaml/filesys

* Add deprecated version of api/filesys with aliases to new code

* Use new kyaml/filesys package and update dependencies

* Migrate to kyaml/filesys and update dependencies

* Skip tests that break on Windows
2021-06-16 11:42:00 -07:00
monopole
a6b9445702 Fix repospec test 2021-05-20 09:52:59 -07:00
Josh Komoroske
24a64bdee3 URL based configuration for git exec timeouts and git submodule cloning
Adds a number of user-accessable options for configuring internal git resource
cloning behavior.
- Git commands are executed with a configurable timeout by including a parameter
  like "?timeout=2m30s" in the resource URL. This can improve cloning a large
  repository, or over a slow network.
- Git submodule cloning can be disabled by including a parameter like
  "?submodules=false" in the resource URL.
- Switch the overall query parsing to use url.Parse() and be more extensible.
2021-05-19 00:07:02 -07:00
jregan
99c9edfc3d Drop close in timed call. 2020-12-28 08:31:42 -08:00
jregan
6bbc829593 Add a loader test. 2020-12-09 17:17:21 -08:00
Thomas Dy
6445e03d1a Don't fetch default branch if ref is specified
Currently, we always fetch the default branch with an initial git clone
and then fetch the ref after if it's specified. This changes it to only
make one fetch instead of two if a ref is specified.
2020-12-02 16:16:30 +09:00
Donny Xia
f02af7a48b remove default master branch in cloner 2020-09-22 15:57:50 -07:00
Pieter Vincken
58c2df2dec fix: add the fetch head in the correct location 2020-06-09 20:22:28 +02:00
Pieter Vincken
cd25740b61 fix: solve issues with tags not being loaded 2020-06-09 19:56:04 +02:00
Pieter Vincken
28045399f3 fix: add missing assignment 2020-06-09 16:57:01 +02:00
Pieter Vincken
e630334837 fix: re-add log outputs 2020-06-09 16:56:20 +02:00
Pieter Vincken
b97df057c1 feat: re-introduce shallow git clones
Making full git clones slows down the kustomize build significantly for big repositories.
2020-06-09 16:35:09 +02:00
Donny Xia
5449dbc775 Fix git commit hash ignored 2020-05-26 14:44:37 -07:00
Yujun Zhang
711bab85ae Revert "Merge pull request #2169 from yujunz/loader/go-getter"
This reverts commit 0b1ad031a9, reversing
changes made to 300dd108d5.
2020-03-07 18:58:46 +08:00
Yujun Zhang
fae66446a8 Replace git cloner with go getter to support various target 2020-03-04 20:04:39 +08:00