Commit Graph

4797 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
4345cd2ade Merge pull request #3534 from KnVerey/starlark_genformer
Fix function/exec transformer plugin ability to add/remove resources
2021-02-04 19:54:51 -08:00
Katrina Verey
1460d13d50 Allow exec and function transformers to delete resources 2021-02-04 13:01:09 -08:00
Katrina Verey
97a2b15be6 Allow exec and function transformers to generate resources 2021-02-04 13:01:09 -08:00
Katrina Verey
f927cf0b8e Regression test for inability to add resources in function-based transfomer 2021-02-04 13:01:09 -08:00
Jeff Regan
cbb121e651 Merge pull request #3533 from monopole/updateNRtest
Update namerefence tests for apimachinery code path.
2021-02-04 12:15:17 -08:00
monopole
447b315a61 Update namerefence tests for apimachinery code path. 2021-02-04 12:14:16 -08:00
Kubernetes Prow Robot
b3cb61b80f Merge pull request #3532 from monopole/commandsOption3
Expose some top level kustomize commands.
2021-02-04 10:02:26 -08:00
monopole
b9f05dd357 Expose some top level kustomize commands.
The PR exposes some of the top level kustomize commands
(especially `build`) for reuse in other command line tools
(expecially `kubectl`, see #1500).

This PR represents option 3 from the following list of ways
this exposure could be arranged.

1. Expose the commands in the `api` module.

```
REPO/api/go.mod
REPO/api/builtins
REPO/api/commands <- new
REPO/api/...
```

Disadvantage: This would make `api` module depend on cobra.
That's bad for clients that want to depend on the api, but
want to write their own commands at their own version of
cobra.  The `api` module shouldn't depend on UX libraries
like cobra.

2. Expose the commands in their own `commands` module.

They'd appear alongside `api`, e.g. `

```
REPO/api/go.mod
REPO/api/builtins
REPO/api/...
REPO/commands/go.mod
REPO/commands/build
REPO/commands/edit
REPO/commands/...
```

Advantage: The commands would be consumed by the kustomize
binary and the kubectl binary in the same way.

Disadvantage: The kustomize binary module and the commands
module could evolve separately with their own version
numbers, creating confusion.

3. Expose the commands in the existing `kustomize` module

```
REPO/api/go.mod
REPO/api/builtins
REPO/api/...
REPO/kustomize/go.mod
REPO/kustomize/main.go
REPO/kustomize/commands/build
REPO/kustomize/commands/edit
REPO/kustomize/commands/...
```

Outside users, e.g. kubectl, could then

```
import sigs.k8s.io/kustomize/kustomize/v3/commands/build
```

and hopefully still get the `main` package
as they do now via:

```
go get sigs.k8s.io/kustomize/kustomize/v3
```

Advantage: 1) The kustomize binary ships at the same version
as the commands - which makes sense as the binary's
_version_ refers to how the CLI operates (command names,
flags, etc.).  This makes it easy to related the version of
a kustomize binary with the version of commands running in
some other CLI binary.  2) The path to the kustomize binary
doesn't change.

Disadvantage: It's an atypical Go module arrangement.
Usually `main` packages live as leaves under a directory
called `cmd` inside a module, rather than at the _top_ of
the module.  This might cause some problems.  If so, we can
go with option 4.

4. Same as 3, but move `main.go` (the `main` package) down one step.

```
REPO/api/go.mod
REPO/api/builtins
REPO/api/...
REPO/kustomize/go.mod
REPO/kustomize/cmd/main.go
REPO/kustomize/commands/build
REPO/kustomize/commands/edit
REPO/kustomize/commands/...
```
2021-02-04 08:35:01 -08:00
Jeff Regan
1ee16d9f52 Merge pull request #3525 from natasha41575/RefactorNameTransformers
Refactored resource to store all previous names and namespaces
2021-02-03 16:53:16 -08:00
Natasha Sarkar
43157f5d35 cleaned up resource refactoring 2021-02-03 14:30:25 -08:00
Natasha Sarkar
cd918483f9 removed some prefix methods from resource 2021-02-03 12:02:12 -08:00
Natasha Sarkar
f71854a0c8 Refactored resource to store all previous names and namespaces 2021-02-03 12:01:09 -08:00
Kubernetes Prow Robot
6246262965 Merge pull request #3529 from monopole/fix3489
Fix 3489
2021-02-03 11:04:28 -08:00
monopole
d3ea87220b Fix Issue 3489. 2021-02-03 10:49:17 -08:00
Jeff Regan
61daea0202 Merge pull request #3245 from natasha41575/UseOpenApiVersions
Use `openApi` field in kustomization file to specify OpenAPI schema version
2021-02-03 10:35:08 -08:00
Jeff Regan
a54cd12b39 Delete fixgomod.sh 2021-02-03 10:20:28 -08:00
Kubernetes Prow Robot
11ce6363b4 Merge pull request #3528 from monopole/refactorNameref
Refactor nameref for readability.
2021-02-03 10:16:29 -08:00
monopole
4de26ccf9d Refactor nameref for readability. 2021-02-02 19:02:41 -08:00
Jeff Regan
7801830152 Merge pull request #3527 from monopole/addTests
Add tests in support of Issue 3489.
2021-02-02 18:53:31 -08:00
monopole
aae2be1a79 Add tests in support of Issue 3489. 2021-02-02 18:35:46 -08:00
Kubernetes Prow Robot
79e15c05d5 Merge pull request #3522 from Shell32-Natsu/chart-generator
fix relative path to values file
2021-02-02 15:44:28 -08:00
Donny Xia
507244e6f8 fix relative path to values file 2021-02-01 13:55:48 -08:00
Jeff Regan
3892e3c910 Merge pull request #3519 from monopole/fieldspectest
More fieldspec filter tests and comments.
2021-01-31 20:01:47 -08:00
monopole
dcb26d0901 More fieldspec tests. 2021-01-31 19:08:48 -08:00
Jeff Regan
f5f1a15226 Merge pull request #3518 from monopole/nits
Improve name reference transformer testing.
2021-01-31 09:04:45 -08:00
monopole
64644643d4 Improve name reference transformer testing. 2021-01-31 08:40:47 -08:00
Jeff Regan
4d1eebbb82 Merge pull request #3517 from monopole/pathSplitter
Expose smart path splitter as a utility.
2021-01-31 07:56:42 -08:00
monopole
b3a9314e27 Expose smart path splitter as a utility. 2021-01-31 06:45:04 -08:00
Kubernetes Prow Robot
86168cebbc Merge pull request #3514 from natasha41575/TestForPortsIssue
Add test for ports issue #3513
2021-01-29 12:51:49 -08:00
Natasha Sarkar
57a53797d3 Add test for ports issue #3513 2021-01-29 11:10:00 -08:00
Kubernetes Prow Robot
f5beffe394 Merge pull request #3512 from monopole/improveNameRefTests
Add test for issue 3489 and improve error messages.
2021-01-29 10:49:41 -08:00
monopole
4287e28ff4 Add test for issue 3489 and improve error messages. 2021-01-29 06:55:23 -08:00
Jeff Regan
a5cdd98414 Merge pull request #3498 from piyushpgupta/patch-1
Update README.md
2021-01-27 17:20:22 -08:00
Piyush Gupta
16a49c50c4 Update README.md 2021-01-28 09:17:39 +09:00
Piyush Gupta
a6f29f2bf7 Update README.md 2021-01-28 09:17:10 +09:00
Piyush Gupta
22fcf3b3fa Update README.md 2021-01-28 09:16:28 +09:00
Piyush Gupta
a31b846fa5 Update README.md 2021-01-28 09:10:59 +09:00
Jeff Regan
22fb23071b Merge pull request #3483 from msk-/master
Bug: configMapRefs in patches are not resolved correctly in diamond structure
2021-01-27 15:43:49 -08:00
Jeff Regan
382cf5c2e0 Merge pull request #3506 from natasha41575/FixSmpDirectiveWhenElementNotFound
$patch:delete should not add elements when element is not found
2021-01-27 11:24:38 -08:00
Jeff Regan
8d4508a041 Merge pull request #3484 from kubernetes-sigs/issue3377
Demonstrate issue #3377 is fixed.
2021-01-26 16:53:58 -08:00
Natasha Sarkar
4d5657f037 smpdirectives shouldn't add elements when element isn't found 2021-01-26 16:43:30 -08:00
Natasha Sarkar
5958edda14 don't merge patches until they are applied 2021-01-26 16:43:15 -08:00
Natasha Sarkar
48676fe34b updated patch delete test 2021-01-26 16:42:59 -08:00
Jeff Regan
a8278b6da9 Merge pull request #3495 from MaXinjian/install
Add support to install kustomize to specified directory
2021-01-26 12:30:46 -08:00
Kubernetes Prow Robot
31d6e24fa4 Merge pull request #3491 from Shell32-Natsu/error-message
add error message for AsYAML
2021-01-26 12:26:30 -08:00
Jeff Regan
25e11e9020 Update install_kustomize.sh 2021-01-26 12:15:20 -08:00
Jeff Regan
d8e2a76ef3 Merge pull request #3499 from MaXinjian/validator
Fix wrong Validator dir
2021-01-26 12:01:41 -08:00
Jeff Regan
cff7bd4eb2 Merge pull request #3496 from msk-/use-usr-bin-env-bash-for-scripts
Use `/usr/bin/env bash` instead of `/bin/bash` in scripts
2021-01-26 12:01:01 -08:00
Kubernetes Prow Robot
58db58202c Merge pull request #3500 from Shell32-Natsu/ingress-name-ref
support anchor in filedspec
2021-01-26 11:48:31 -08:00
Donny Xia
fc29d7e108 Merge pull request #3503 from dimw/3487-set-image-tag-name
Add support for setting new tag while preserving the current name
2021-01-26 10:32:33 -08:00