Commit Graph

21 Commits

Author SHA1 Message Date
jregan
47c965481f Reduce k8ds deps 2019-05-27 15:37:03 -07:00
Jeffrey Regan
3b8c5ee96d Add load_restrictor flag. 2019-04-19 17:33:51 -07:00
Jeffrey Regan
3c58c9d132 Remove local load restrictions. 2019-04-19 15:47:13 -07:00
jregan
103c1b3a4f Put goplugins behind flag. 2019-03-17 13:39:48 -07:00
Jeffrey Regan
ccc4461827 Fix nil ptr bug 2019-02-07 10:11:45 -08:00
jregan
35daae1715 Delete some dead code and fix nits. 2019-01-29 14:13:46 -08:00
Jeffrey Regan
8c2bff2c91 Disallow cloned kustomization from using a local base outside the clone dir. 2019-01-29 10:31:52 -08:00
Jeffrey Regan
31691f0330 Replace all repo uri strings with git.RepoSpec. 2019-01-28 15:31:42 -08:00
jregan
ad400cd13d Introduce RepoSpec.
This PR closes a TODO in the fileLoader type to
replace the string representing a git repo url
with a struct called holding validated fields.

New struct is called RepoSpec.

It holds what we need in coming PRs for remote
repo base containment checks, and will also allow
the overlay cycle prevention code to take into
account different host schemes or branches.

The struct is in a new file called repospec.go.
The new file is mostly just a code move of url
parsing code that was in cloner.go.  Git "blame"
history preserved through the move.

No change in execution (see final commit by itself).
2019-01-27 07:47:52 -08:00
jregan
1d9a20b391 Move git code to its own pkg. 2019-01-26 17:06:48 -08:00
jregan
dcb5682594 Add more coverage for loader and strengthen type safety. 2019-01-25 14:43:28 -08:00
Jeffrey Regan
c21dfefbdf Cover CleanedAbs 2019-01-25 12:21:03 -08:00
Jeffrey Regan
2e6bdd4041 Add more loader tests. 2019-01-22 14:08:28 -08:00
Jeffrey Regan
14af70d148 Restrict loading to root or below. 2019-01-16 11:13:37 -08:00
Jeffrey Regan
ea1dd08a8c Small cleanups, no change in exec. 2019-01-14 15:35:03 -08:00
jregan
4f9d00c021 Enforce relocatabile kustomizations. 2018-11-22 09:07:05 -08:00
jregan
793577d044 Consult history in fileloader.
Fixes #366

To reproduce #366, add

```
bases:
- .
```

to `examples/helloWorld/kustomization.yaml`, attempt to build it, and enjoy the stack overflow.

This PR fixes this by adding history to file loaders,
allowing one to avoid cycles in overlay->base
relationships.  To make entry points clearer, this PR
exposes only two public ways to make a fresh
(no-history) loader

 * rooted at `/`
 * rooted at the process's current working directory.

When making a new loader from an existing loader,
retaining history along an overlay trace, the only
allowed use is to go deeper into a file hierarchy, or
go up and over to a never before visited sibling. This
fix can probably be defeated by devious symbolic links.
2018-10-29 11:10:21 -07:00
jregan
885c1952a4 Improve test coverage. 2018-10-28 13:52:25 -07:00
Jingfang Liu
64fdb8d760 change github.com/kubernetes-sigs to sigs.k8s.io (#343)
* change github.com/kubernetes-sigs to sigs.k8s.io

* change go_import_path in .travis.yml
2018-09-12 12:41:38 -07:00
Jingfang Liu
72b1a4bc5c combine fileLoader.New and NewLoader into one function: NewLoader 2018-08-15 11:04:31 -07:00
Jeffrey Regan
9e5374e725 Combine loaderImpl and fileLoader. 2018-07-25 17:23:04 -07:00