mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 01:30:51 +00:00
Compare commits
243 Commits
release-ap
...
api/v0.18.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faccc12624 | ||
|
|
fdf9f59cb5 | ||
|
|
e2967cf3ce | ||
|
|
d22fa37ae0 | ||
|
|
01cce4f6cc | ||
|
|
54cbcdc698 | ||
|
|
b36b222b26 | ||
|
|
2cd9a2e73a | ||
|
|
d32eacf034 | ||
|
|
88f19bffa9 | ||
|
|
a3c0b4add7 | ||
|
|
b67ce5bb73 | ||
|
|
5ba8523df7 | ||
|
|
4034e36ee1 | ||
|
|
c3872ce3d9 | ||
|
|
d35d21c2d0 | ||
|
|
3872752338 | ||
|
|
a5f43ec75a | ||
|
|
e6266d4559 | ||
|
|
99efd6995a | ||
|
|
b7cdd9168a | ||
|
|
27d508fa03 | ||
|
|
05339dafe5 | ||
|
|
bbb0b08576 | ||
|
|
77daec89b8 | ||
|
|
a1fd6efe5d | ||
|
|
cc9dd34216 | ||
|
|
2aaa42f950 | ||
|
|
f660160a0f | ||
|
|
d4248b1213 | ||
|
|
bd8b8a49c9 | ||
|
|
ddeb572a7f | ||
|
|
36d78f67fd | ||
|
|
4e52632bd3 | ||
|
|
8eacab0fc6 | ||
|
|
1a41303fbb | ||
|
|
7cbaf78b1a | ||
|
|
735ad0beef | ||
|
|
c1de0301f5 | ||
|
|
5cfd3ab3e7 | ||
|
|
dfb30644f4 | ||
|
|
e3a7615ccb | ||
|
|
b02d02a6cd | ||
|
|
804f69bacf | ||
|
|
9ab7762a40 | ||
|
|
44a99b7284 | ||
|
|
692b40e515 | ||
|
|
bef46a1a04 | ||
|
|
48d79c745a | ||
|
|
856662835f | ||
|
|
cba3688960 | ||
|
|
16a7ce2b8b | ||
|
|
92e862c233 | ||
|
|
8db4c4b062 | ||
|
|
cb432b0350 | ||
|
|
88c89f422a | ||
|
|
ce80dc9e2b | ||
|
|
226d56b5cf | ||
|
|
f309dfc54a | ||
|
|
a34ac31a80 | ||
|
|
9cc25a511c | ||
|
|
f6ad718ee6 | ||
|
|
da14e76359 | ||
|
|
7424956ccf | ||
|
|
77354d73b9 | ||
|
|
3065eb36dd | ||
|
|
b67959894e | ||
|
|
6a829feef8 | ||
|
|
e244b83844 | ||
|
|
f9838461af | ||
|
|
49a645f05d | ||
|
|
e7a15496dd | ||
|
|
0d7d830236 | ||
|
|
e676d056b2 | ||
|
|
b1a9bffd8b | ||
|
|
a83f102cc9 | ||
|
|
0e649599d0 | ||
|
|
a68f40738a | ||
|
|
72d95b5f41 | ||
|
|
671de1662d | ||
|
|
25c7e17fb8 | ||
|
|
2e6171a9ea | ||
|
|
7f99cebdc6 | ||
|
|
5d127e4138 | ||
|
|
bcb1a367aa | ||
|
|
ed09399cd1 | ||
|
|
82ee768212 | ||
|
|
116b307b88 | ||
|
|
fb9f45ebe0 | ||
|
|
536c1c0a8b | ||
|
|
e20e438d05 | ||
|
|
42873c8d2a | ||
|
|
277da9ed21 | ||
|
|
2b00d887fd | ||
|
|
08d0593c3e | ||
|
|
31706fd7fd | ||
|
|
e862612703 | ||
|
|
1b449768b5 | ||
|
|
a9f7a0427a | ||
|
|
cd954ce6fe | ||
|
|
10c292f501 | ||
|
|
a9bfabc771 | ||
|
|
398aa3666f | ||
|
|
8f2d2436ec | ||
|
|
fd06780f3e | ||
|
|
562cbc132d | ||
|
|
d5f3c4fad9 | ||
|
|
f1599f6498 | ||
|
|
c0b3801c7a | ||
|
|
f0681429ea | ||
|
|
a6bbbe843c | ||
|
|
2c68a4d2d4 | ||
|
|
b3d1df2644 | ||
|
|
8d21d43cf7 | ||
|
|
eabf2d41d3 | ||
|
|
ed2ca23400 | ||
|
|
63329d175a | ||
|
|
6145a4be44 | ||
|
|
8fef99fa35 | ||
|
|
f63e919e3e | ||
|
|
3d840a6584 | ||
|
|
a6149b1c88 | ||
|
|
91b92b52c1 | ||
|
|
d7e60b8451 | ||
|
|
846d3c09eb | ||
|
|
fbc102dbd3 | ||
|
|
a7de0cc8cd | ||
|
|
931f924189 | ||
|
|
50dc813731 | ||
|
|
9db92fd28d | ||
|
|
d514df3db0 | ||
|
|
22ce9c02bf | ||
|
|
43868688d5 | ||
|
|
434a55a244 | ||
|
|
a6ea3e2bb6 | ||
|
|
72f0a3cfb1 | ||
|
|
1eccd8f4b7 | ||
|
|
4dbc0d22e1 | ||
|
|
e9fc57abd6 | ||
|
|
d35edbf80d | ||
|
|
da3985c284 | ||
|
|
14a9a9849f | ||
|
|
8aafbacd17 | ||
|
|
4da880d6cb | ||
|
|
62eca858f3 | ||
|
|
11704312be | ||
|
|
74ba2fb141 | ||
|
|
cc410bc23a | ||
|
|
2252fd951a | ||
|
|
33caee50cb | ||
|
|
28ef9da0d9 | ||
|
|
db2240c9c1 | ||
|
|
d3329453a2 | ||
|
|
6ffcc08591 | ||
|
|
facabded61 | ||
|
|
9d66eb16c8 | ||
|
|
6088692165 | ||
|
|
9e68399e04 | ||
|
|
e25f99ee02 | ||
|
|
37715863f0 | ||
|
|
3e69c2e36a | ||
|
|
17eab513e9 | ||
|
|
800e12b5ae | ||
|
|
96c6bbad2c | ||
|
|
1fa02e729d | ||
|
|
f93b0ead3c | ||
|
|
f80650e8ce | ||
|
|
bcf100f592 | ||
|
|
9546529f1d | ||
|
|
91ccf00ac8 | ||
|
|
f8f4203fb7 | ||
|
|
537c4fa5c2 | ||
|
|
dc7ebef925 | ||
|
|
b154361c00 | ||
|
|
3bb9a6d414 | ||
|
|
14c091aec7 | ||
|
|
6c1fea79ed | ||
|
|
ca8d629230 | ||
|
|
fd09a6ed50 | ||
|
|
23fbdd2ab5 | ||
|
|
27a8ff9d23 | ||
|
|
cf01ceb2f6 | ||
|
|
3bd9ea8ee7 | ||
|
|
d223b9d55e | ||
|
|
31b852c7bc | ||
|
|
add367bf2e | ||
|
|
b1b61ad4cf | ||
|
|
d73f0fd097 | ||
|
|
bf286dce76 | ||
|
|
d768fc371c | ||
|
|
7e392f9117 | ||
|
|
4675bec08a | ||
|
|
26165a86b7 | ||
|
|
69826668a7 | ||
|
|
a85dfd4141 | ||
|
|
abdcae870c | ||
|
|
dd49bd4c6d | ||
|
|
4adb7f9604 | ||
|
|
40ce15cca3 | ||
|
|
4e93959754 | ||
|
|
ab519fdc13 | ||
|
|
f3fedac429 | ||
|
|
3f921e159b | ||
|
|
d56e1d0f46 | ||
|
|
872968c420 | ||
|
|
f72db33d5e | ||
|
|
cfa2c41b44 | ||
|
|
0c461d61df | ||
|
|
27ae0693b4 | ||
|
|
42d5870546 | ||
|
|
f814039f99 | ||
|
|
b28e0445a2 | ||
|
|
7db7de65c1 | ||
|
|
a34dd1fc3f | ||
|
|
cd886102a9 | ||
|
|
2831689a1b | ||
|
|
069c5fd5d7 | ||
|
|
504e805da0 | ||
|
|
3cf12635d4 | ||
|
|
9adb7535fa | ||
|
|
c87c7a139c | ||
|
|
50583c4b0e | ||
|
|
9a7014cc14 | ||
|
|
32a78f3915 | ||
|
|
f866701088 | ||
|
|
49e911fcef | ||
|
|
665bfbc32d | ||
|
|
a0a9bdfe05 | ||
|
|
16f7e42392 | ||
|
|
bf485f66d3 | ||
|
|
557d6cba2d | ||
|
|
8eee90d2c6 | ||
|
|
9da0cf8b4c | ||
|
|
c259c478e5 | ||
|
|
82bd395289 | ||
|
|
e3031f3a7b | ||
|
|
7b1eaf1e4f | ||
|
|
fefa21fa01 | ||
|
|
5c7f8b8d73 | ||
|
|
71546359b8 | ||
|
|
234ab80086 | ||
|
|
f910219c7a | ||
|
|
d37c0eb477 |
@@ -1,7 +1,5 @@
|
|||||||
.github
|
.github
|
||||||
docs
|
docs
|
||||||
examples
|
examples
|
||||||
hack
|
|
||||||
site
|
|
||||||
travis
|
travis
|
||||||
*.md
|
*.md
|
||||||
|
|||||||
4
.github/workflows/apidiff.yml
vendored
4
.github/workflows/apidiff.yml
vendored
@@ -17,11 +17,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
- name: Execute go-apidiff
|
- name: Execute go-apidiff
|
||||||
uses: joelanford/go-apidiff@v0.7.0
|
uses: joelanford/go-apidiff@v0.8.2
|
||||||
with:
|
with:
|
||||||
compare-imports: true
|
compare-imports: true
|
||||||
print-compatible: true
|
print-compatible: true
|
||||||
|
|||||||
31
.github/workflows/go.yml
vendored
31
.github/workflows/go.yml
vendored
@@ -10,8 +10,25 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
conditional-changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
doc: ${{ steps.filter.outputs.doc }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
doc:
|
||||||
|
- 'site/**'
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
|
needs: conditional-changes
|
||||||
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
@@ -19,7 +36,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
id: go
|
id: go
|
||||||
@@ -30,12 +47,14 @@ jobs:
|
|||||||
|
|
||||||
test-linux:
|
test-linux:
|
||||||
name: Test Linux
|
name: Test Linux
|
||||||
|
needs: conditional-changes
|
||||||
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
||||||
runs-on: [ubuntu-latest]
|
runs-on: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
id: go
|
id: go
|
||||||
@@ -46,12 +65,14 @@ jobs:
|
|||||||
|
|
||||||
test-macos:
|
test-macos:
|
||||||
name: Test MacOS
|
name: Test MacOS
|
||||||
|
needs: conditional-changes
|
||||||
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
||||||
runs-on: [macos-latest]
|
runs-on: [macos-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
id: go
|
id: go
|
||||||
@@ -62,12 +83,14 @@ jobs:
|
|||||||
|
|
||||||
test-windows:
|
test-windows:
|
||||||
name: Test Windows
|
name: Test Windows
|
||||||
|
needs: conditional-changes
|
||||||
|
# if: needs.conditional-changes.outputs.doc == 'false'
|
||||||
runs-on: [windows-latest]
|
runs-on: [windows-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code into the Go module directory
|
- name: Check out code into the Go module directory
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
id: go
|
id: go
|
||||||
|
|||||||
5
.github/workflows/release.yaml
vendored
5
.github/workflows/release.yaml
vendored
@@ -1,5 +1,8 @@
|
|||||||
name: release
|
name: release
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # Allow actions to update dependabot PRs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
@@ -17,7 +20,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up Go 1.x
|
- name: Set up Go 1.x
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: go.work
|
go-version-file: go.work
|
||||||
id: go
|
id: go
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
run:
|
run:
|
||||||
deadline: 5m
|
deadline: 5m
|
||||||
go: '1.20'
|
go: '1.22'
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
@@ -35,6 +35,10 @@ linters:
|
|||||||
- maintidx
|
- maintidx
|
||||||
- nosnakecase
|
- nosnakecase
|
||||||
- testpackage # it's better to keep tests in the same package for now because kustomize does open box testing
|
- testpackage # it's better to keep tests in the same package for now because kustomize does open box testing
|
||||||
|
- structcheck # abandoned by author
|
||||||
|
- varcheck # abandoned by author
|
||||||
|
- maligned # abandoned by author
|
||||||
|
- interfacer # archived by author
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
dupl:
|
dupl:
|
||||||
|
|||||||
@@ -75,14 +75,39 @@ cd kustomize
|
|||||||
git push origin myfeature
|
git push origin myfeature
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Pull Request Rules
|
||||||
|
|
||||||
|
We are using [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) as the main guideline of making PR. This guideline serves to help contributor and maintainer to classify their changes, thus providing better insight on type of release will be covered on each Kustomize release cycle.
|
||||||
|
|
||||||
|
1. Please add these keywords on your PR titles accordingly
|
||||||
|
|
||||||
|
| Keyword | Description | Example |
|
||||||
|
| ------------- | ------------- | ------------- |
|
||||||
|
| fix | Patching or fixing bugs or improvements introduction from previous release. This type of change will mark a `PATCH` release. | fix: fix null value when generating yaml |
|
||||||
|
| feat | New features. This change will mark a `MINOR` release. | feat: new transformer and generator for ACME API CRD. |
|
||||||
|
| chore | Minor improvement outside main code base | chore: add exclusion for transformer test. |
|
||||||
|
| ci | CI/CD related changes (e.g. github workflow, scripts, CI steps). | ci: remove blocking tests |
|
||||||
|
| docs | Changes related to documentation. | docs: add rules documentation for PR. |
|
||||||
|
|
||||||
|
|
||||||
|
2. Add `BREAKING CHANGE:` on your commit message as footer to signify breaking changes. This will help maintainers identify `MAJOR` releases.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
feat: change YAML parser from `yaml/v1` to `yaml/v2`
|
||||||
|
|
||||||
|
BREAKING CHANGE: parse() function now works with 2 arguments.
|
||||||
|
```
|
||||||
|
|
||||||
### Create a Pull Request
|
### Create a Pull Request
|
||||||
|
|
||||||
1. Visit your fork at `https://github.com/<user>/kustomize`
|
1. Visit your fork at `https://github.com/<user>/kustomize`
|
||||||
2. Click the **Compare & Pull Request** button next to your `myfeature` branch.
|
2. Click the **Compare & Pull Request** button next to your `myfeature` branch.
|
||||||
3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice.
|
3. Check out the pull request [process](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md) for more details and advice.
|
||||||
|
|
||||||
If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request.
|
If you ran `git push` in the previous step, GitHub will return a useful link to create a Pull Request.
|
||||||
|
|
||||||
|
|
||||||
### Build Kustomize
|
### Build Kustomize
|
||||||
The [Kustomize Architecture] document describes the respository organization and the kustomize build process.
|
The [Kustomize Architecture] document describes the respository organization and the kustomize build process.
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
34
Makefile
34
Makefile
@@ -3,7 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for kustomize CLI and API.
|
# Makefile for kustomize CLI and API.
|
||||||
|
|
||||||
LATEST_RELEASE=v5.2.1
|
LATEST_RELEASE=v5.4.3
|
||||||
|
|
||||||
SHELL := /usr/bin/env bash
|
SHELL := /usr/bin/env bash
|
||||||
GOOS = $(shell go env GOOS)
|
GOOS = $(shell go env GOOS)
|
||||||
@@ -56,26 +56,24 @@ uninstall-local-tools:
|
|||||||
|
|
||||||
# Build from local source.
|
# Build from local source.
|
||||||
$(MYGOBIN)/gorepomod:
|
$(MYGOBIN)/gorepomod:
|
||||||
cd cmd/gorepomod; \
|
cd cmd/gorepomod && go install .
|
||||||
go install .
|
|
||||||
|
|
||||||
# Build from local source.
|
# Build from local source.
|
||||||
$(MYGOBIN)/k8scopy:
|
$(MYGOBIN)/k8scopy:
|
||||||
cd cmd/k8scopy; \
|
cd cmd/k8scopy && go install .
|
||||||
go install .
|
|
||||||
|
|
||||||
# Build from local source.
|
# Build from local source.
|
||||||
$(MYGOBIN)/pluginator:
|
$(MYGOBIN)/pluginator:
|
||||||
cd cmd/pluginator; \
|
cd cmd/pluginator && go install .
|
||||||
go install .
|
|
||||||
|
|
||||||
|
|
||||||
# --- Build targets ---
|
# --- Build targets ---
|
||||||
|
|
||||||
# Build from local source.
|
# Build from local source.
|
||||||
$(MYGOBIN)/kustomize: build-kustomize-api
|
$(MYGOBIN)/kustomize: build-kustomize-api
|
||||||
cd kustomize; \
|
cd kustomize && go install -ldflags \
|
||||||
go install -ldflags "-X sigs.k8s.io/kustomize/api/provenance.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
"-X sigs.k8s.io/kustomize/api/provenance.buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||||
|
-X sigs.k8s.io/kustomize/api/provenance.version=$(shell git describe --tags --always --dirty)" \
|
||||||
.
|
.
|
||||||
|
|
||||||
kustomize: $(MYGOBIN)/kustomize
|
kustomize: $(MYGOBIN)/kustomize
|
||||||
@@ -84,11 +82,11 @@ kustomize: $(MYGOBIN)/kustomize
|
|||||||
# plugin-to-api compatibility checks.
|
# plugin-to-api compatibility checks.
|
||||||
.PHONY: build-kustomize-api
|
.PHONY: build-kustomize-api
|
||||||
build-kustomize-api: $(MYGOBIN)/goimports $(builtinplugins)
|
build-kustomize-api: $(MYGOBIN)/goimports $(builtinplugins)
|
||||||
cd api; $(MAKE) build
|
cd api && $(MAKE) build
|
||||||
|
|
||||||
.PHONY: generate-kustomize-api
|
.PHONY: generate-kustomize-api
|
||||||
generate-kustomize-api:
|
generate-kustomize-api:
|
||||||
cd api; $(MAKE) generate
|
cd api && $(MAKE) generate
|
||||||
|
|
||||||
|
|
||||||
# --- Verification targets ---
|
# --- Verification targets ---
|
||||||
@@ -130,12 +128,8 @@ lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/goimports $(builtinplugins)
|
|||||||
./hack/for-each-module.sh "make lint"
|
./hack/for-each-module.sh "make lint"
|
||||||
|
|
||||||
.PHONY: apidiff
|
.PHONY: apidiff
|
||||||
apidiff: go-apidiff ## Run the go-apidiff to verify any API differences compared with origin/master
|
apidiff: $(MYGOBIN)/go-apidiff ## Run the go-apidiff to verify any API differences compared with origin/master
|
||||||
$(GOBIN)/go-apidiff master --compare-imports --print-compatible --repo-path=.
|
go-apidiff master --compare-imports --print-compatible --repo-path=.
|
||||||
|
|
||||||
.PHONY: go-apidiff
|
|
||||||
go-apidiff:
|
|
||||||
go install github.com/joelanford/go-apidiff@v0.6.0
|
|
||||||
|
|
||||||
.PHONY: test-unit-all
|
.PHONY: test-unit-all
|
||||||
test-unit-all: \
|
test-unit-all: \
|
||||||
@@ -145,14 +139,14 @@ test-unit-all: \
|
|||||||
# This target is used by our Github Actions CI to run unit tests for all non-plugin modules in multiple GOOS environments.
|
# This target is used by our Github Actions CI to run unit tests for all non-plugin modules in multiple GOOS environments.
|
||||||
.PHONY: test-unit-non-plugin
|
.PHONY: test-unit-non-plugin
|
||||||
test-unit-non-plugin:
|
test-unit-non-plugin:
|
||||||
./hack/for-each-module.sh "make test" "./plugin/*" 19
|
./hack/for-each-module.sh "make test" "./plugin/*" 20
|
||||||
|
|
||||||
.PHONY: build-non-plugin-all
|
.PHONY: build-non-plugin-all
|
||||||
build-non-plugin-all:
|
build-non-plugin-all:
|
||||||
./hack/for-each-module.sh "make build" "./plugin/*" 19
|
./hack/for-each-module.sh "make build" "./plugin/*" 20
|
||||||
|
|
||||||
.PHONY: test-unit-kustomize-plugins
|
.PHONY: test-unit-kustomize-plugins
|
||||||
test-unit-kustomize-plugins:
|
test-unit-kustomize-plugins: build-kustomize-external-go-plugin
|
||||||
./hack/testUnitKustomizePlugins.sh
|
./hack/testUnitKustomizePlugins.sh
|
||||||
|
|
||||||
.PHONY: functions-examples-all
|
.PHONY: functions-examples-all
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ generate-kustomize-builtin-plugins: $(builtplugins)
|
|||||||
echo "generating $${plugin} ..."; \
|
echo "generating $${plugin} ..."; \
|
||||||
set -e; \
|
set -e; \
|
||||||
cd $${plugin}; \
|
cd $${plugin}; \
|
||||||
go generate pluginator .; \
|
go generate .; \
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check for diff by comparing current revision of generated plugins on HEAD and newly generated plugins on local branch,
|
# Check for diff by comparing current revision of generated plugins on HEAD and newly generated plugins on local branch,
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
# Copyright 2022 The Kubernetes Authors.
|
# Copyright 2022 The Kubernetes Authors.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
GOLANGCI_LINT_VERSION=v1.51.2
|
GOOS = $(shell go env GOOS)
|
||||||
|
GOARCH = $(shell go env GOARCH)
|
||||||
MYGOBIN = $(shell go env GOBIN)
|
MYGOBIN = $(shell go env GOBIN)
|
||||||
ifeq ($(MYGOBIN),)
|
ifeq ($(MYGOBIN),)
|
||||||
MYGOBIN = $(shell go env GOPATH)/bin
|
MYGOBIN = $(shell go env GOPATH)/bin
|
||||||
endif
|
endif
|
||||||
export PATH := $(MYGOBIN):$(PATH)
|
export PATH := $(MYGOBIN):$(PATH)
|
||||||
|
|
||||||
|
REPO_ROOT=$(shell git rev-parse --show-toplevel)
|
||||||
|
|
||||||
# determines whether to run tests that only behave locally; can be overridden by override variable
|
# determines whether to run tests that only behave locally; can be overridden by override variable
|
||||||
export IS_LOCAL = false
|
export IS_LOCAL = false
|
||||||
|
|
||||||
@@ -18,8 +20,7 @@ install-out-of-tree-tools: \
|
|||||||
$(MYGOBIN)/golangci-lint \
|
$(MYGOBIN)/golangci-lint \
|
||||||
$(MYGOBIN)/helmV3 \
|
$(MYGOBIN)/helmV3 \
|
||||||
$(MYGOBIN)/mdrip \
|
$(MYGOBIN)/mdrip \
|
||||||
$(MYGOBIN)/stringer \
|
$(MYGOBIN)/stringer
|
||||||
$(MYGOBIN)/goimports
|
|
||||||
|
|
||||||
.PHONY: uninstall-out-of-tree-tools
|
.PHONY: uninstall-out-of-tree-tools
|
||||||
uninstall-out-of-tree-tools:
|
uninstall-out-of-tree-tools:
|
||||||
@@ -29,67 +30,61 @@ uninstall-out-of-tree-tools:
|
|||||||
rm -f $(MYGOBIN)/mdrip
|
rm -f $(MYGOBIN)/mdrip
|
||||||
rm -f $(MYGOBIN)/stringer
|
rm -f $(MYGOBIN)/stringer
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/golangci-lint
|
||||||
$(MYGOBIN)/golangci-lint:
|
$(MYGOBIN)/golangci-lint:
|
||||||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)
|
cd $(REPO_ROOT)/hack && go install github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/mdrip
|
||||||
$(MYGOBIN)/mdrip:
|
$(MYGOBIN)/mdrip:
|
||||||
go install github.com/monopole/mdrip@v1.0.2
|
cd $(REPO_ROOT)/hack && go install github.com/monopole/mdrip
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/stringer
|
||||||
$(MYGOBIN)/stringer:
|
$(MYGOBIN)/stringer:
|
||||||
go install golang.org/x/tools/cmd/stringer@latest
|
cd $(REPO_ROOT)/hack && go install golang.org/x/tools/cmd/stringer
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/goimports
|
||||||
$(MYGOBIN)/goimports:
|
$(MYGOBIN)/goimports:
|
||||||
go install golang.org/x/tools/cmd/goimports@latest
|
cd $(REPO_ROOT)/hack && go install golang.org/x/tools/cmd/goimports
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/mdtogo
|
||||||
$(MYGOBIN)/mdtogo:
|
$(MYGOBIN)/mdtogo:
|
||||||
go install sigs.k8s.io/kustomize/cmd/mdtogo@latest
|
cd $(REPO_ROOT)/hack && go install sigs.k8s.io/kustomize/cmd/mdtogo
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/addlicense
|
||||||
$(MYGOBIN)/addlicense:
|
$(MYGOBIN)/addlicense:
|
||||||
go install github.com/google/addlicense@latest
|
cd $(REPO_ROOT)/hack && go install github.com/google/addlicense
|
||||||
|
|
||||||
$(MYGOBIN)/goreleaser:
|
|
||||||
go install github.com/goreleaser/goreleaser@v0.179.0 # https://github.com/kubernetes-sigs/kustomize/issues/4542
|
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/kind
|
||||||
$(MYGOBIN)/kind:
|
$(MYGOBIN)/kind:
|
||||||
( \
|
cd $(REPO_ROOT)/hack && go install sigs.k8s.io/kind
|
||||||
set -e; \
|
|
||||||
d=$(shell mktemp -d); cd $$d; \
|
|
||||||
wget -O ./kind https://github.com/kubernetes-sigs/kind/releases/download/v0.7.0/kind-$(GOOS)-$(GOARCH); \
|
|
||||||
chmod +x ./kind; \
|
|
||||||
mv ./kind $(MYGOBIN); \
|
|
||||||
rm -rf $$d; \
|
|
||||||
)
|
|
||||||
|
|
||||||
# linux only.
|
.PHONY: $(MYGOBIN)/controller-gen
|
||||||
|
$(MYGOBIN)/controller-gen:
|
||||||
|
cd $(REPO_ROOT)/hack && go install sigs.k8s.io/controller-tools/cmd/controller-gen
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/embedmd
|
||||||
|
$(MYGOBIN)/embedmd:
|
||||||
|
cd $(REPO_ROOT)/hack && go install github.com/campoy/embedmd
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/go-bindata
|
||||||
|
$(MYGOBIN)/go-bindata:
|
||||||
|
cd $(REPO_ROOT)/hack && go install github.com/go-bindata/go-bindata/v3/go-bindata
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/go-apidiff
|
||||||
|
$(MYGOBIN)/go-apidiff:
|
||||||
|
cd $(REPO_ROOT)/hack && go install github.com/joelanford/go-apidiff
|
||||||
|
|
||||||
|
.PHONY: $(MYGOBIN)/gh
|
||||||
$(MYGOBIN)/gh:
|
$(MYGOBIN)/gh:
|
||||||
( \
|
cd $(REPO_ROOT)/hack && go install github.com/cli/cli/cmd/gh
|
||||||
set -e; \
|
|
||||||
d=$(shell mktemp -d); cd $$d; \
|
|
||||||
tgzFile=gh_1.0.0_$(GOOS)_$(GOARCH).tar.gz; \
|
|
||||||
wget https://github.com/cli/cli/releases/download/v1.0.0/$$tgzFile; \
|
|
||||||
tar -xvzf $$tgzFile; \
|
|
||||||
mv gh_1.0.0_$(GOOS)_$(GOARCH)/bin/gh $(MYGOBIN)/gh; \
|
|
||||||
rm -rf $$d \
|
|
||||||
)
|
|
||||||
|
|
||||||
# linux only.
|
.PHONY: $(MYGOBIN)/kubeval
|
||||||
# This is for testing an example plugin that
|
|
||||||
# uses kubeval for validation.
|
|
||||||
# Don't want to add a hard dependence in go.mod file
|
|
||||||
# to github.com/instrumenta/kubeval.
|
|
||||||
# Instead, download the binary.
|
|
||||||
$(MYGOBIN)/kubeval:
|
$(MYGOBIN)/kubeval:
|
||||||
( \
|
cd $(REPO_ROOT)/hack && go install github.com/instrumenta/kubeval
|
||||||
set -e; \
|
|
||||||
d=$(shell mktemp -d); cd $$d; \
|
|
||||||
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-$(GOOS)-$(GOARCH).tar.gz; \
|
|
||||||
tar xf kubeval-$(GOOS)-$(GOARCH).tar.gz; \
|
|
||||||
mv kubeval $(MYGOBIN); \
|
|
||||||
rm -rf $$d; \
|
|
||||||
)
|
|
||||||
|
|
||||||
# Helm V3 differs from helm V2; downloading it to provide coverage for the
|
# Helm V3 differs from helm V2; downloading it to provide coverage for the
|
||||||
# chart inflator plugin under helm v3.
|
# chart inflator plugin under helm v3.
|
||||||
|
.PHONY: $(MYGOBIN)/helmV3
|
||||||
$(MYGOBIN)/helmV3:
|
$(MYGOBIN)/helmV3:
|
||||||
( \
|
( \
|
||||||
set -e; \
|
set -e; \
|
||||||
|
|||||||
@@ -3,21 +3,28 @@
|
|||||||
aliases:
|
aliases:
|
||||||
kustomize-owners:
|
kustomize-owners:
|
||||||
- knverey
|
- knverey
|
||||||
- natasha41575
|
- koba1t
|
||||||
kustomize-approvers:
|
kustomize-approvers:
|
||||||
- knverey
|
- knverey
|
||||||
- natasha41575
|
|
||||||
- annasong20
|
|
||||||
- koba1t
|
- koba1t
|
||||||
|
- varshaprasad96
|
||||||
kustomize-reviewers:
|
kustomize-reviewers:
|
||||||
- knverey
|
- knverey
|
||||||
- natasha41575
|
|
||||||
- yuwenma
|
|
||||||
- annasong20
|
|
||||||
- koba1t
|
- koba1t
|
||||||
- stormqueen1990
|
- stormqueen1990
|
||||||
- varshaprasad96
|
- varshaprasad96
|
||||||
- ncapps
|
- ncapps
|
||||||
|
|
||||||
|
docs-approvers:
|
||||||
|
- ncapps
|
||||||
|
docs-reviewers:
|
||||||
|
- ncapps
|
||||||
|
|
||||||
|
commands-approvers:
|
||||||
|
- stormqueen1990
|
||||||
|
commands-reviewers:
|
||||||
|
- stormqueen1990
|
||||||
|
|
||||||
# emeritus:
|
# emeritus:
|
||||||
# - liujingfang1
|
# - liujingfang1
|
||||||
# - Shell32-Natsu
|
# - Shell32-Natsu
|
||||||
@@ -27,3 +34,6 @@ aliases:
|
|||||||
# - mengqiy
|
# - mengqiy
|
||||||
# - mortent
|
# - mortent
|
||||||
# - phanimarupaka
|
# - phanimarupaka
|
||||||
|
# - natasha41575
|
||||||
|
# - annasong20
|
||||||
|
# - yuwenma
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ This tool is sponsored by [sig-cli] ([KEP]).
|
|||||||
To find the kustomize version embedded in recent versions of kubectl, run `kubectl version`:
|
To find the kustomize version embedded in recent versions of kubectl, run `kubectl version`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
> kubectl version --short --client
|
> kubectl version --client
|
||||||
Client Version: v1.26.0
|
Client Version: v1.31.0
|
||||||
Kustomize Version: v4.5.7
|
Kustomize Version: v5.4.2
|
||||||
```
|
```
|
||||||
|
|
||||||
The kustomize build flow at [v2.0.3] was added
|
The kustomize build flow at [v2.0.3] was added
|
||||||
|
|||||||
15
api/Makefile
15
api/Makefile
@@ -11,3 +11,18 @@ build:
|
|||||||
|
|
||||||
generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer
|
generate: $(MYGOBIN)/k8scopy $(MYGOBIN)/stringer
|
||||||
go generate ./...
|
go generate ./...
|
||||||
|
|
||||||
|
lint: lint-api-static
|
||||||
|
|
||||||
|
## lint-api-static runs the linter on the API module
|
||||||
|
## with build-tag kustomize_disable_go_plugin_support
|
||||||
|
## this aims to catch any issues with the API module
|
||||||
|
## that would prevent the API module from being used
|
||||||
|
## when the go plugin support is disabled.
|
||||||
|
lint-api-static:
|
||||||
|
$(MYGOBIN)/golangci-lint cache clean # Workaround for https://github.com/golangci/golangci-lint/issues/3228
|
||||||
|
$(MYGOBIN)/golangci-lint \
|
||||||
|
-c $$KUSTOMIZE_ROOT/.golangci.yml \
|
||||||
|
--build-tags kustomize_disable_go_plugin_support \
|
||||||
|
--path-prefix api \
|
||||||
|
run ./...
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/filters/fieldspec"
|
"sigs.k8s.io/kustomize/api/filters/fieldspec"
|
||||||
"sigs.k8s.io/kustomize/api/filters/filtersutil"
|
"sigs.k8s.io/kustomize/api/filters/filtersutil"
|
||||||
"sigs.k8s.io/kustomize/kyaml/kio"
|
"sigs.k8s.io/kustomize/kyaml/kio"
|
||||||
@@ -621,7 +622,7 @@ kind: Pod
|
|||||||
|
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
err := yaml.Unmarshal([]byte(tc.fieldSpec), &filter.FieldSpec)
|
err := yaml.Unmarshal([]byte(tc.fieldSpec), &filter.FieldSpec)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
rw := &kio.ByteReadWriter{
|
rw := &kio.ByteReadWriter{
|
||||||
Reader: bytes.NewBufferString(tc.input),
|
Reader: bytes.NewBufferString(tc.input),
|
||||||
Writer: &bytes.Buffer{},
|
Writer: &bytes.Buffer{},
|
||||||
@@ -635,7 +636,7 @@ kind: Pod
|
|||||||
Outputs: []kio.Writer{rw},
|
Outputs: []kio.Writer{rw},
|
||||||
}.Execute()
|
}.Execute()
|
||||||
|
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, tc.expected, fieldPaths)
|
assert.Equal(t, tc.expected, fieldPaths)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -284,9 +284,9 @@ func (f Filter) roleRefFilter() sieveFunc {
|
|||||||
return previousIdSelectedByGvk(roleRefGvk)
|
return previousIdSelectedByGvk(roleRefGvk)
|
||||||
}
|
}
|
||||||
|
|
||||||
func prefixSuffixEquals(other resource.ResCtx) sieveFunc {
|
func prefixSuffixEquals(other resource.ResCtx, allowEmpty bool) sieveFunc {
|
||||||
return func(r *resource.Resource) bool {
|
return func(r *resource.Resource) bool {
|
||||||
return r.PrefixesSuffixesEquals(other)
|
return r.PrefixesSuffixesEquals(other, allowEmpty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,7 +325,10 @@ func (f Filter) selectReferral(
|
|||||||
if len(candidates) == 1 {
|
if len(candidates) == 1 {
|
||||||
return candidates[0], nil
|
return candidates[0], nil
|
||||||
}
|
}
|
||||||
candidates = doSieve(candidates, prefixSuffixEquals(f.Referrer))
|
candidates = doSieve(candidates, prefixSuffixEquals(f.Referrer, true))
|
||||||
|
if len(candidates) > 1 {
|
||||||
|
candidates = doSieve(candidates, prefixSuffixEquals(f.Referrer, false))
|
||||||
|
}
|
||||||
if len(candidates) == 1 {
|
if len(candidates) == 1 {
|
||||||
return candidates[0], nil
|
return candidates[0], nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package patchjson6902
|
|||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
jsonpatch "gopkg.in/evanphx/json-patch.v5"
|
jsonpatch "gopkg.in/evanphx/json-patch.v4"
|
||||||
"sigs.k8s.io/kustomize/kyaml/kio"
|
"sigs.k8s.io/kustomize/kyaml/kio"
|
||||||
"sigs.k8s.io/kustomize/kyaml/yaml"
|
"sigs.k8s.io/kustomize/kyaml/yaml"
|
||||||
k8syaml "sigs.k8s.io/yaml"
|
k8syaml "sigs.k8s.io/yaml"
|
||||||
|
|||||||
27
api/go.mod
27
api/go.mod
@@ -1,37 +1,34 @@
|
|||||||
module sigs.k8s.io/kustomize/api
|
module sigs.k8s.io/kustomize/api
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/blang/semver/v4 v4.0.0
|
||||||
github.com/go-errors/errors v1.4.2
|
github.com/go-errors/errors v1.4.2
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
|
||||||
github.com/imdario/mergo v0.3.13
|
github.com/stretchr/testify v1.9.0
|
||||||
github.com/stretchr/testify v1.8.1
|
|
||||||
go.uber.org/goleak v1.3.0
|
go.uber.org/goleak v1.3.0
|
||||||
gopkg.in/evanphx/json-patch.v5 v5.6.0
|
gopkg.in/evanphx/json-patch.v4 v4.12.0
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0
|
sigs.k8s.io/kustomize/kyaml v0.18.1
|
||||||
sigs.k8s.io/yaml v1.4.0
|
sigs.k8s.io/yaml v1.4.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/sergi/go-diff v1.1.0 // indirect
|
github.com/sergi/go-diff v1.2.0 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
60
api/go.sum
60
api/go.sum
@@ -1,37 +1,38 @@
|
|||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
|
||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
|
||||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||||
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
|
|
||||||
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
|
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -42,51 +43,52 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/
|
|||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
|
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
|
||||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/evanphx/json-patch.v5 v5.6.0 h1:BMT6KIwBD9CaU91PJCZIe46bDmBWa9ynTQgJIOpfQBk=
|
gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4=
|
||||||
gopkg.in/evanphx/json-patch.v5 v5.6.0/go.mod h1:/kvTRh1TVm5wuM6OkHxqXtE/1nUZZpihg29RtuIyfvk=
|
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0 h1:6J33uKSoATlKZH16unr2XOhDI+otoe2sR3M8PDzW3K0=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0/go.mod h1:xOK/7i+vmE14N2FdFyugIshB8eF6ALpy7jI87Q2nRh4=
|
sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=
|
||||||
|
sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo=
|
||||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ func loadCrdIntoConfig(
|
|||||||
}
|
}
|
||||||
_, label := property.Extensions.GetString(xLabelSelector)
|
_, label := property.Extensions.GetString(xLabelSelector)
|
||||||
if label {
|
if label {
|
||||||
err = theConfig.AddLabelFieldSpec(
|
err = theConfig.AddCommonLabelsFieldSpec(
|
||||||
makeFs(theGvk, append(path, propName)))
|
makeFs(theGvk, append(path, propName)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -590,7 +590,7 @@ func TestNameReferenceUnhappyRun(t *testing.T) {
|
|||||||
func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
||||||
rf := provider.NewDefaultDepProvider().GetResourceFactory()
|
rf := provider.NewDefaultDepProvider().GetResourceFactory()
|
||||||
|
|
||||||
v1 := rf.FromMapWithName(
|
v1, err := rf.FromMapWithName(
|
||||||
"volume1",
|
"volume1",
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
@@ -599,7 +599,10 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
|||||||
"name": "someprefix-volume1",
|
"name": "someprefix-volume1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
c1 := rf.FromMapWithName(
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||||
|
}
|
||||||
|
c1, err := rf.FromMapWithName(
|
||||||
"claim1",
|
"claim1",
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
@@ -612,9 +615,11 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
|||||||
"volumeName": "volume1",
|
"volumeName": "volume1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||||
|
}
|
||||||
v2 := v1.DeepCopy()
|
v2 := v1.DeepCopy()
|
||||||
c2 := rf.FromMapWithName(
|
c2, err := rf.FromMapWithName(
|
||||||
"claim1",
|
"claim1",
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
@@ -627,6 +632,9 @@ func TestNameReferencePersistentVolumeHappyRun(t *testing.T) {
|
|||||||
"volumeName": "someprefix-volume1",
|
"volumeName": "someprefix-volume1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get new instance with given name: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(v1).AddR(c1).ResMap()
|
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(v1).AddR(c1).ResMap()
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func makeResAccumulator(t *testing.T) *ResAccumulator {
|
|||||||
"name": "backendTwo",
|
"name": "backendTwo",
|
||||||
}}).ResMap())
|
}}).ResMap())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected err: %v", err)
|
t.Fatalf("failed to append resources: %v", err)
|
||||||
}
|
}
|
||||||
return ra
|
return ra
|
||||||
}
|
}
|
||||||
@@ -143,22 +143,26 @@ func expectLog(t *testing.T, log bytes.Buffer, expect string) {
|
|||||||
func TestResolveVarsVarNeedsDisambiguation(t *testing.T) {
|
func TestResolveVarsVarNeedsDisambiguation(t *testing.T) {
|
||||||
ra := makeResAccumulator(t)
|
ra := makeResAccumulator(t)
|
||||||
rm0 := resmap.New()
|
rm0 := resmap.New()
|
||||||
err := rm0.Append(
|
|
||||||
provider.NewDefaultDepProvider().GetResourceFactory().FromMap(
|
r, err := provider.NewDefaultDepProvider().GetResourceFactory().FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "Service",
|
"kind": "Service",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "backendOne",
|
"name": "backendOne",
|
||||||
"namespace": "fooNamespace",
|
"namespace": "fooNamespace",
|
||||||
},
|
},
|
||||||
}))
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected err: %v", err)
|
t.Fatalf("failed to get instance of resources: %v", err)
|
||||||
|
}
|
||||||
|
err = rm0.Append(r)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to append a resource to ResMap: %v", err)
|
||||||
}
|
}
|
||||||
err = ra.AppendAll(rm0)
|
err = ra.AppendAll(rm0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected err: %v", err)
|
t.Fatalf("failed to append a resource to ResAccumulator: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ra.MergeVars([]types.Var{
|
err = ra.MergeVars([]types.Var{
|
||||||
@@ -227,7 +231,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
|||||||
// create accumulators holding apparently conflicting vars that are not
|
// create accumulators holding apparently conflicting vars that are not
|
||||||
// actually in conflict because they point to the same concrete value.
|
// actually in conflict because they point to the same concrete value.
|
||||||
rm0 := resmap.New()
|
rm0 := resmap.New()
|
||||||
err := rm0.Append(rf.FromMap(fooAws))
|
r0, err0 := rf.FromMap(fooAws)
|
||||||
|
if err0 != nil {
|
||||||
|
t.Fatalf("failed to get instance of resources: %v", err0)
|
||||||
|
}
|
||||||
|
err := rm0.Append(r0)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ac0 := MakeEmptyAccumulator()
|
ac0 := MakeEmptyAccumulator()
|
||||||
err = ac0.AppendAll(rm0)
|
err = ac0.AppendAll(rm0)
|
||||||
@@ -236,7 +244,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
rm1 := resmap.New()
|
rm1 := resmap.New()
|
||||||
err = rm1.Append(rf.FromMap(barAws))
|
r1, err1 := rf.FromMap(barAws)
|
||||||
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get instance of resources: %v", err1)
|
||||||
|
}
|
||||||
|
err = rm1.Append(r1)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ac1 := MakeEmptyAccumulator()
|
ac1 := MakeEmptyAccumulator()
|
||||||
err = ac1.AppendAll(rm1)
|
err = ac1.AppendAll(rm1)
|
||||||
@@ -255,7 +267,11 @@ func TestResolveVarConflicts(t *testing.T) {
|
|||||||
// two above (because it contains a variable whose name is used in the other
|
// two above (because it contains a variable whose name is used in the other
|
||||||
// accumulators AND whose concrete values are different).
|
// accumulators AND whose concrete values are different).
|
||||||
rm2 := resmap.New()
|
rm2 := resmap.New()
|
||||||
err = rm2.Append(rf.FromMap(barGcp))
|
r2, err2 := rf.FromMap(barGcp)
|
||||||
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get instance of resources: %v", err2)
|
||||||
|
}
|
||||||
|
err = rm2.Append(r2)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
ac2 := MakeEmptyAccumulator()
|
ac2 := MakeEmptyAccumulator()
|
||||||
err = ac2.AppendAll(rm2)
|
err = ac2.AppendAll(rm2)
|
||||||
|
|||||||
@@ -10,13 +10,15 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/imdario/mergo"
|
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kyaml/errors"
|
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||||
"sigs.k8s.io/kustomize/kyaml/kio"
|
"sigs.k8s.io/kustomize/kyaml/kio"
|
||||||
|
kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/yaml/merge2"
|
||||||
"sigs.k8s.io/yaml"
|
"sigs.k8s.io/yaml"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -61,6 +63,9 @@ func (p *HelmChartInflationGeneratorPlugin) Config(
|
|||||||
if len(h.GeneralConfig().HelmConfig.ApiVersions) != 0 {
|
if len(h.GeneralConfig().HelmConfig.ApiVersions) != 0 {
|
||||||
p.HelmChart.ApiVersions = h.GeneralConfig().HelmConfig.ApiVersions
|
p.HelmChart.ApiVersions = h.GeneralConfig().HelmConfig.ApiVersions
|
||||||
}
|
}
|
||||||
|
if h.GeneralConfig().HelmConfig.Debug {
|
||||||
|
p.HelmChart.Debug = h.GeneralConfig().HelmConfig.Debug
|
||||||
|
}
|
||||||
|
|
||||||
p.h = h
|
p.h = h
|
||||||
if err = yaml.Unmarshal(config, p); err != nil {
|
if err = yaml.Unmarshal(config, p); err != nil {
|
||||||
@@ -167,13 +172,17 @@ func (p *HelmChartInflationGeneratorPlugin) runHelmCommand(
|
|||||||
fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.ConfigHome)}
|
fmt.Sprintf("HELM_DATA_HOME=%s/.data", p.ConfigHome)}
|
||||||
cmd.Env = append(os.Environ(), env...)
|
cmd.Env = append(os.Environ(), env...)
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
|
errorOutput := stderr.String()
|
||||||
|
if slices.Contains(args, "--debug") {
|
||||||
|
errorOutput = " Helm stack trace:\n" + errorOutput + "\nHelm template:\n" + stdout.String() + "\n"
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
helm := p.h.GeneralConfig().HelmConfig.Command
|
helm := p.h.GeneralConfig().HelmConfig.Command
|
||||||
err = errors.WrapPrefixf(
|
err = errors.WrapPrefixf(
|
||||||
fmt.Errorf(
|
fmt.Errorf(
|
||||||
"unable to run: '%s %s' with env=%s (is '%s' installed?): %w",
|
"unable to run: '%s %s' with env=%s (is '%s' installed?): %w",
|
||||||
helm, strings.Join(args, " "), env, helm, err),
|
helm, strings.Join(args, " "), env, helm, err),
|
||||||
stderr.String(),
|
errorOutput,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return stdout.Bytes(), err
|
return stdout.Bytes(), err
|
||||||
@@ -201,18 +210,33 @@ func (p *HelmChartInflationGeneratorPlugin) replaceValuesInline() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
chValues := make(map[string]interface{})
|
chValues, err := kyaml.Parse(string(pValues))
|
||||||
if err = yaml.Unmarshal(pValues, &chValues); err != nil {
|
if err != nil {
|
||||||
return err
|
return errors.WrapPrefixf(err, "could not parse values file into rnode")
|
||||||
}
|
}
|
||||||
|
inlineValues, err := kyaml.FromMap(p.ValuesInline)
|
||||||
|
if err != nil {
|
||||||
|
return errors.WrapPrefixf(err, "could not parse values inline into rnode")
|
||||||
|
}
|
||||||
|
var outValues *kyaml.RNode
|
||||||
switch p.ValuesMerge {
|
switch p.ValuesMerge {
|
||||||
|
// Function `merge2.Merge` overrides values in dest with values from src.
|
||||||
|
// To achieve override or merge behavior, we pass parameters in different order.
|
||||||
|
// Object passed as dest will be modified, so we copy it just in case someone
|
||||||
|
// decides to use it after this is called.
|
||||||
case valuesMergeOptionOverride:
|
case valuesMergeOptionOverride:
|
||||||
err = mergo.Merge(
|
outValues, err = merge2.Merge(inlineValues, chValues.Copy(), kyaml.MergeOptions{})
|
||||||
&chValues, p.ValuesInline, mergo.WithOverride)
|
|
||||||
case valuesMergeOptionMerge:
|
case valuesMergeOptionMerge:
|
||||||
err = mergo.Merge(&chValues, p.ValuesInline)
|
outValues, err = merge2.Merge(chValues, inlineValues.Copy(), kyaml.MergeOptions{})
|
||||||
}
|
}
|
||||||
p.ValuesInline = chValues
|
if err != nil {
|
||||||
|
return errors.WrapPrefixf(err, "could not merge values")
|
||||||
|
}
|
||||||
|
mapValues, err := outValues.Map()
|
||||||
|
if err != nil {
|
||||||
|
return errors.WrapPrefixf(err, "could not parse merged values into map")
|
||||||
|
}
|
||||||
|
p.ValuesInline = mapValues
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package builtins
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
jsonpatch "gopkg.in/evanphx/json-patch.v5"
|
jsonpatch "gopkg.in/evanphx/json-patch.v4"
|
||||||
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
|
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
jsonpatch "gopkg.in/evanphx/json-patch.v5"
|
jsonpatch "gopkg.in/evanphx/json-patch.v4"
|
||||||
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
|
"sigs.k8s.io/kustomize/api/filters/patchjson6902"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/resource"
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
|
|||||||
@@ -74,34 +74,16 @@ func (p *SortOrderTransformerPlugin) Transform(m resmap.ResMap) (err error) {
|
|||||||
|
|
||||||
// Sort
|
// Sort
|
||||||
if p.SortOptions.Order == types.LegacySortOrder {
|
if p.SortOptions.Order == types.LegacySortOrder {
|
||||||
s := newLegacyIDSorter(m.AllIds(), p.SortOptions.LegacySortOptions)
|
s := newLegacyIDSorter(m.Resources(), p.SortOptions.LegacySortOptions)
|
||||||
sort.Sort(s)
|
sort.Sort(s)
|
||||||
err = applyOrdering(m, s.resids)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// applyOrdering takes resources (given in ResMap) and a desired ordering given
|
// Clear the map and re-add the resources in the sorted order.
|
||||||
// as a sequence of ResIds, and updates the ResMap's resources to match the
|
m.Clear()
|
||||||
// ordering.
|
for _, r := range s.resources {
|
||||||
func applyOrdering(m resmap.ResMap, ordering []resid.ResId) error {
|
err := m.Append(r)
|
||||||
var err error
|
if err != nil {
|
||||||
resources := make([]*resource.Resource, m.Size())
|
return errors.WrapPrefixf(err, "SortOrderTransformer: Failed to append to resources")
|
||||||
// Clear and refill with the correct order
|
}
|
||||||
for i, id := range ordering {
|
|
||||||
resources[i], err = m.GetByCurrentId(id)
|
|
||||||
if err != nil {
|
|
||||||
return errors.WrapPrefixf(err, "expected match for sorting")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Clear()
|
|
||||||
for _, r := range resources {
|
|
||||||
err = m.Append(r)
|
|
||||||
if err != nil {
|
|
||||||
return errors.WrapPrefixf(err, "SortOrderTransformer: Failed to append to resources")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -117,12 +99,17 @@ func applyOrdering(m resmap.ResMap, ordering []resid.ResId) error {
|
|||||||
type legacyIDSorter struct {
|
type legacyIDSorter struct {
|
||||||
// resids only stores the metadata of the object. This is an optimization as
|
// resids only stores the metadata of the object. This is an optimization as
|
||||||
// it's expensive to compute these again and again during ordering.
|
// it's expensive to compute these again and again during ordering.
|
||||||
resids []resid.ResId
|
resids []resid.ResId
|
||||||
|
// Initially, we sorted the metadata (ResId) of each object and then called GetByCurrentId on each to construct the final list.
|
||||||
|
// The problem is that GetByCurrentId is inefficient and does a linear scan in a list every time we do that.
|
||||||
|
// So instead, we sort resources alongside the ResIds.
|
||||||
|
resources []*resource.Resource
|
||||||
|
|
||||||
typeOrders map[string]int
|
typeOrders map[string]int
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLegacyIDSorter(
|
func newLegacyIDSorter(
|
||||||
resids []resid.ResId,
|
resources []*resource.Resource,
|
||||||
options *types.LegacySortOptions) *legacyIDSorter {
|
options *types.LegacySortOptions) *legacyIDSorter {
|
||||||
// Precalculate a resource ranking based on the priority lists.
|
// Precalculate a resource ranking based on the priority lists.
|
||||||
var typeOrders = func() map[string]int {
|
var typeOrders = func() map[string]int {
|
||||||
@@ -135,10 +122,13 @@ func newLegacyIDSorter(
|
|||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
}()
|
}()
|
||||||
return &legacyIDSorter{
|
|
||||||
resids: resids,
|
ret := &legacyIDSorter{typeOrders: typeOrders}
|
||||||
typeOrders: typeOrders,
|
for _, res := range resources {
|
||||||
|
ret.resids = append(ret.resids, res.CurId())
|
||||||
|
ret.resources = append(ret.resources, res)
|
||||||
}
|
}
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ sort.Interface = legacyIDSorter{}
|
var _ sort.Interface = legacyIDSorter{}
|
||||||
@@ -146,6 +136,7 @@ var _ sort.Interface = legacyIDSorter{}
|
|||||||
func (a legacyIDSorter) Len() int { return len(a.resids) }
|
func (a legacyIDSorter) Len() int { return len(a.resids) }
|
||||||
func (a legacyIDSorter) Swap(i, j int) {
|
func (a legacyIDSorter) Swap(i, j int) {
|
||||||
a.resids[i], a.resids[j] = a.resids[j], a.resids[i]
|
a.resids[i], a.resids[j] = a.resids[j], a.resids[i]
|
||||||
|
a.resources[i], a.resources[j] = a.resources[j], a.resources[i]
|
||||||
}
|
}
|
||||||
func (a legacyIDSorter) Less(i, j int) bool {
|
func (a legacyIDSorter) Less(i, j int) bool {
|
||||||
if !a.resids[i].Gvk.Equals(a.resids[j].Gvk) {
|
if !a.resids[i].Gvk.Equals(a.resids[j].Gvk) {
|
||||||
@@ -160,6 +151,9 @@ func gvkLessThan(gvk1, gvk2 resid.Gvk, typeOrders map[string]int) bool {
|
|||||||
if index1 != index2 {
|
if index1 != index2 {
|
||||||
return index1 < index2
|
return index1 < index2
|
||||||
}
|
}
|
||||||
|
if (gvk1.Kind == types.NamespaceKind && gvk2.Kind == types.NamespaceKind) && (gvk1.Group == "" || gvk2.Group == "") {
|
||||||
|
return legacyGVKSortString(gvk1) > legacyGVKSortString(gvk2)
|
||||||
|
}
|
||||||
return legacyGVKSortString(gvk1) < legacyGVKSortString(gvk2)
|
return legacyGVKSortString(gvk1) < legacyGVKSortString(gvk2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -421,6 +421,13 @@ nameReference:
|
|||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- path: spec/ingressClassName
|
- path: spec/ingressClassName
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
|
|
||||||
|
- kind: ValidatingAdmissionPolicy
|
||||||
|
group: admissionregistration.k8s.io
|
||||||
|
fieldSpecs:
|
||||||
|
- path: spec/policyName
|
||||||
|
kind: ValidatingAdmissionPolicyBinding
|
||||||
|
group: admissionregistration.k8s.io
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ func (lc *localizer) localizeFileWithContent(path string, content []byte) (strin
|
|||||||
// 2. avoid paths that temporarily traverse outside the current root,
|
// 2. avoid paths that temporarily traverse outside the current root,
|
||||||
// i.e. ../../../scope/target/current-root. The localized file will be surrounded by
|
// i.e. ../../../scope/target/current-root. The localized file will be surrounded by
|
||||||
// different directories than its source, and so an uncleaned path may no longer be valid.
|
// different directories than its source, and so an uncleaned path may no longer be valid.
|
||||||
locPath = cleanFilePath(lc.fSys, lc.root, path)
|
locPath = cleanedRelativePath(lc.fSys, lc.root, path)
|
||||||
}
|
}
|
||||||
absPath := filepath.Join(lc.dst, locPath)
|
absPath := filepath.Join(lc.dst, locPath)
|
||||||
if err := lc.fSys.MkdirAll(filepath.Dir(absPath)); err != nil {
|
if err := lc.fSys.MkdirAll(filepath.Dir(absPath)); err != nil {
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ func reportFSysDiff(t *testing.T, fSysExpected filesys.FileSystem, fSysActual fi
|
|||||||
actualContent, readErr := fSysActual.ReadFile(path)
|
actualContent, readErr := fSysActual.ReadFile(path)
|
||||||
require.NoError(t, readErr)
|
require.NoError(t, readErr)
|
||||||
expectedContent, findErr := fSysExpected.ReadFile(path)
|
expectedContent, findErr := fSysExpected.ReadFile(path)
|
||||||
assert.NoErrorf(t, findErr, "unexpected file %q", path)
|
require.NoErrorf(t, findErr, "unexpected file %q", path)
|
||||||
if findErr == nil {
|
if findErr == nil {
|
||||||
assert.Equal(t, string(expectedContent), string(actualContent))
|
assert.Equal(t, string(expectedContent), string(actualContent))
|
||||||
}
|
}
|
||||||
@@ -296,8 +296,10 @@ func TestLocalizeFileCleaned(t *testing.T) {
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
patches:
|
patches:
|
||||||
- path: ../gamma/../../../alpha/beta/./gamma/patch.yaml
|
- path: ../gamma/../../../alpha/beta/./gamma/patch.yaml
|
||||||
|
- path: /alpha/beta/../beta/./gamma/patch2.yaml
|
||||||
`,
|
`,
|
||||||
"patch.yaml": podConfiguration,
|
"patch.yaml": podConfiguration,
|
||||||
|
"patch2.yaml": podConfiguration,
|
||||||
}
|
}
|
||||||
expected, actual := makeFileSystems(t, "/alpha/beta/gamma", kustAndPatch)
|
expected, actual := makeFileSystems(t, "/alpha/beta/gamma", kustAndPatch)
|
||||||
|
|
||||||
@@ -307,8 +309,10 @@ patches:
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
patches:
|
patches:
|
||||||
- path: patch.yaml
|
- path: patch.yaml
|
||||||
|
- path: patch2.yaml
|
||||||
`,
|
`,
|
||||||
"patch.yaml": podConfiguration,
|
"patch.yaml": podConfiguration,
|
||||||
|
"patch2.yaml": podConfiguration,
|
||||||
})
|
})
|
||||||
checkFSys(t, expected, actual)
|
checkFSys(t, expected, actual)
|
||||||
}
|
}
|
||||||
@@ -1194,19 +1198,40 @@ func TestLocalizeResources(t *testing.T) {
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- pod.yaml
|
- pod.yaml
|
||||||
|
- /a/b/pod2.yaml
|
||||||
- ../../alpha
|
- ../../alpha
|
||||||
`,
|
`,
|
||||||
"pod.yaml": podConfiguration,
|
"pod.yaml": podConfiguration,
|
||||||
|
"pod2.yaml": podConfiguration,
|
||||||
"../../alpha/kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
"../../alpha/kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namePrefix: my-
|
namePrefix: my-
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
expected, actual := makeFileSystems(t, "/a/b", kustAndResources)
|
|
||||||
|
|
||||||
checkRun(t, actual, "/a/b", "/", "/localized-b")
|
// Absolute path of `/a/b/pod2.yaml` is expected to be converted to a path
|
||||||
addFiles(t, expected, "/localized-b/a/b", kustAndResources)
|
// relative to the kustomization root.
|
||||||
checkFSys(t, expected, actual)
|
expectedKustAndResources := map[string]string{
|
||||||
|
"kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
resources:
|
||||||
|
- pod.yaml
|
||||||
|
- pod2.yaml
|
||||||
|
- ../../alpha
|
||||||
|
`,
|
||||||
|
"pod.yaml": podConfiguration,
|
||||||
|
"pod2.yaml": podConfiguration,
|
||||||
|
"../../alpha/kustomization.yaml": `apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namePrefix: my-
|
||||||
|
`,
|
||||||
|
}
|
||||||
|
|
||||||
|
expectedFs, actualFs := makeFileSystems(t, "/a/b", kustAndResources)
|
||||||
|
|
||||||
|
checkRun(t, actualFs, "/a/b", "/", "/localized-b")
|
||||||
|
addFiles(t, expectedFs, "/localized-b/a/b", expectedKustAndResources)
|
||||||
|
checkFSys(t, expectedFs, actualFs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLocalizePathError(t *testing.T) {
|
func TestLocalizePathError(t *testing.T) {
|
||||||
|
|||||||
@@ -89,11 +89,8 @@ func (ll *Loader) Load(path string) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.WrapPrefixf(err, "invalid file reference")
|
return nil, errors.WrapPrefixf(err, "invalid file reference")
|
||||||
}
|
}
|
||||||
if filepath.IsAbs(path) {
|
|
||||||
return nil, errors.Errorf("absolute paths not yet supported in alpha: file path %q is absolute", path)
|
|
||||||
}
|
|
||||||
if !loader.IsRemoteFile(path) && ll.local {
|
if !loader.IsRemoteFile(path) && ll.local {
|
||||||
cleanPath := cleanFilePath(ll.fSys, filesys.ConfirmedDir(ll.Root()), path)
|
cleanPath := cleanedRelativePath(ll.fSys, filesys.ConfirmedDir(ll.Root()), path)
|
||||||
cleanAbs := filepath.Join(ll.Root(), cleanPath)
|
cleanAbs := filepath.Join(ll.Root(), cleanPath)
|
||||||
dir := filesys.ConfirmedDir(filepath.Dir(cleanAbs))
|
dir := filesys.ConfirmedDir(filepath.Dir(cleanAbs))
|
||||||
// target cannot reference newDir, as this load would've failed prior to localize;
|
// target cannot reference newDir, as this load would've failed prior to localize;
|
||||||
|
|||||||
@@ -276,11 +276,11 @@ func TestLoadFails(t *testing.T) {
|
|||||||
checkNewLoader(req, ldr, &args, "/a", "/a", "/a/newDir", fSys)
|
checkNewLoader(req, ldr, &args, "/a", "/a", "/a/newDir", fSys)
|
||||||
|
|
||||||
cases := map[string]string{
|
cases := map[string]string{
|
||||||
"absolute path": "/a/pod.yaml",
|
"directory": "b",
|
||||||
"directory": "b",
|
"non-existent file": "kubectl.yaml",
|
||||||
"non-existent file": "kubectl.yaml",
|
"file outside root": "../alpha/beta/gamma/delta/deployment.yaml",
|
||||||
"file outside root": "../alpha/beta/gamma/delta/deployment.yaml",
|
"inside dst": "newDir/pod.yaml",
|
||||||
"inside dst": "newDir/pod.yaml",
|
"winding inside dst": "/a/test/../newDir/pod.yaml",
|
||||||
}
|
}
|
||||||
for name, file := range cases {
|
for name, file := range cases {
|
||||||
file := file
|
file := file
|
||||||
@@ -291,8 +291,6 @@ func TestLoadFails(t *testing.T) {
|
|||||||
ldr, _, err := NewLoader("./a/../a", "/a/../a", "/a/newDir", fSys)
|
ldr, _, err := NewLoader("./a/../a", "/a/../a", "/a/newDir", fSys)
|
||||||
req.NoError(err)
|
req.NoError(err)
|
||||||
|
|
||||||
req.NoError(fSys.WriteFile("/a/newDir/pod.yaml", []byte(podConfiguration)))
|
|
||||||
|
|
||||||
_, err = ldr.Load(file)
|
_, err = ldr.Load(file)
|
||||||
req.Error(err)
|
req.Error(err)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -112,9 +112,13 @@ func hasRef(repoURL string) bool {
|
|||||||
return repoSpec.Ref != ""
|
return repoSpec.Ref != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanFilePath returns file cleaned, where file is a relative path to root on fSys
|
// cleanedRelativePath returns a cleaned relative path of file to root on fSys
|
||||||
func cleanFilePath(fSys filesys.FileSystem, root filesys.ConfirmedDir, file string) string {
|
func cleanedRelativePath(fSys filesys.FileSystem, root filesys.ConfirmedDir, file string) string {
|
||||||
abs := root.Join(file)
|
abs := file
|
||||||
|
if !filepath.IsAbs(file) {
|
||||||
|
abs = root.Join(file)
|
||||||
|
}
|
||||||
|
|
||||||
dir, f, err := fSys.CleanedAbs(abs)
|
dir, f, err := fSys.CleanedAbs(abs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("cannot clean validated file path %q: %s", abs, err)
|
log.Fatalf("cannot clean validated file path %q: %s", abs, err)
|
||||||
|
|||||||
@@ -301,3 +301,26 @@ func TestLocRootPath_SymlinkPath(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, expected, actual)
|
require.Equal(t, expected, actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestCleanedRelativePath(t *testing.T) {
|
||||||
|
fSys := filesys.MakeFsInMemory()
|
||||||
|
require.NoError(t, fSys.MkdirAll("/root/test"))
|
||||||
|
require.NoError(t, fSys.WriteFile("/root/test/file.yaml", []byte("")))
|
||||||
|
require.NoError(t, fSys.WriteFile("/root/filetwo.yaml", []byte("")))
|
||||||
|
|
||||||
|
// Absolute path is cleaned to relative path
|
||||||
|
cleanedPath := cleanedRelativePath(fSys, "/root/", "/root/test/file.yaml")
|
||||||
|
require.Equal(t, "test/file.yaml", cleanedPath)
|
||||||
|
|
||||||
|
// Winding absolute path is cleaned to relative path
|
||||||
|
cleanedPath = cleanedRelativePath(fSys, "/root/", "/root/test/../filetwo.yaml")
|
||||||
|
require.Equal(t, "filetwo.yaml", cleanedPath)
|
||||||
|
|
||||||
|
// Already clean relative path stays the same
|
||||||
|
cleanedPath = cleanedRelativePath(fSys, "/root/", "test/file.yaml")
|
||||||
|
require.Equal(t, "test/file.yaml", cleanedPath)
|
||||||
|
|
||||||
|
// Winding relative path is cleaned
|
||||||
|
cleanedPath = cleanedRelativePath(fSys, "/root/", "test/../filetwo.yaml")
|
||||||
|
require.Equal(t, "filetwo.yaml", cleanedPath)
|
||||||
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func loadDefaultConfig(
|
|||||||
// makeTransformerConfigFromBytes returns a TransformerConfig object from bytes
|
// makeTransformerConfigFromBytes returns a TransformerConfig object from bytes
|
||||||
func makeTransformerConfigFromBytes(data []byte) (*TransformerConfig, error) {
|
func makeTransformerConfigFromBytes(data []byte) (*TransformerConfig, error) {
|
||||||
var t TransformerConfig
|
var t TransformerConfig
|
||||||
err := yaml.Unmarshal(data, &t)
|
err := yaml.UnmarshalStrict(data, &t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package builtinconfig
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/internal/loader"
|
"sigs.k8s.io/kustomize/api/internal/loader"
|
||||||
@@ -44,3 +45,28 @@ namePrefix:
|
|||||||
t.Fatalf("expected %v\n but go6t %v\n", expected, tCfg)
|
t.Fatalf("expected %v\n but go6t %v\n", expected, tCfg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestLoadDefaultConfigsFromFilesWithMissingFields(t *testing.T) {
|
||||||
|
fSys := filesys.MakeFsInMemory()
|
||||||
|
filePathContainsTypo := "config_contains_typo.yaml"
|
||||||
|
if err := fSys.WriteFile(filePathContainsTypo, []byte(`
|
||||||
|
namoPrefix:
|
||||||
|
- path: nameprefix/path
|
||||||
|
kind: SomeKind
|
||||||
|
`)); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
ldr, err := loader.NewLoader(
|
||||||
|
loader.RestrictionRootOnly, filesys.Separator, fSys)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
errMsg := "error unmarshaling JSON: while decoding JSON: json: unknown field"
|
||||||
|
_, err = loadDefaultConfig(ldr, []string{filePathContainsTypo})
|
||||||
|
if err == nil {
|
||||||
|
t.Fatalf("expected to fail unmarshal yaml, but got nil %s", filePathContainsTypo)
|
||||||
|
}
|
||||||
|
if !strings.Contains(err.Error(), errMsg) {
|
||||||
|
t.Fatalf("expected error %s, but got %s", errMsg, err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ type TransformerConfig struct {
|
|||||||
NameSuffix types.FsSlice `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"`
|
NameSuffix types.FsSlice `json:"nameSuffix,omitempty" yaml:"nameSuffix,omitempty"`
|
||||||
NameSpace types.FsSlice `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
NameSpace types.FsSlice `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||||
CommonLabels types.FsSlice `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
|
CommonLabels types.FsSlice `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
|
||||||
|
Labels types.FsSlice `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||||
TemplateLabels types.FsSlice `json:"templateLabels,omitempty" yaml:"templateLabels,omitempty"`
|
TemplateLabels types.FsSlice `json:"templateLabels,omitempty" yaml:"templateLabels,omitempty"`
|
||||||
CommonAnnotations types.FsSlice `json:"commonAnnotations,omitempty" yaml:"commonAnnotations,omitempty"`
|
CommonAnnotations types.FsSlice `json:"commonAnnotations,omitempty" yaml:"commonAnnotations,omitempty"`
|
||||||
NameReference nbrSlice `json:"nameReference,omitempty" yaml:"nameReference,omitempty"`
|
NameReference nbrSlice `json:"nameReference,omitempty" yaml:"nameReference,omitempty"`
|
||||||
@@ -41,6 +42,7 @@ func (t *TransformerConfig) DeepCopy() *TransformerConfig {
|
|||||||
NameSuffix: t.NameSuffix.DeepCopy(),
|
NameSuffix: t.NameSuffix.DeepCopy(),
|
||||||
NameSpace: t.NameSpace.DeepCopy(),
|
NameSpace: t.NameSpace.DeepCopy(),
|
||||||
CommonLabels: t.CommonLabels.DeepCopy(),
|
CommonLabels: t.CommonLabels.DeepCopy(),
|
||||||
|
Labels: t.Labels.DeepCopy(),
|
||||||
TemplateLabels: t.TemplateLabels.DeepCopy(),
|
TemplateLabels: t.TemplateLabels.DeepCopy(),
|
||||||
CommonAnnotations: t.CommonAnnotations.DeepCopy(),
|
CommonAnnotations: t.CommonAnnotations.DeepCopy(),
|
||||||
NameReference: t.NameReference.DeepCopy(),
|
NameReference: t.NameReference.DeepCopy(),
|
||||||
@@ -94,6 +96,7 @@ func (t *TransformerConfig) sortFields() {
|
|||||||
sort.Sort(t.NameSuffix)
|
sort.Sort(t.NameSuffix)
|
||||||
sort.Sort(t.NameSpace)
|
sort.Sort(t.NameSpace)
|
||||||
sort.Sort(t.CommonLabels)
|
sort.Sort(t.CommonLabels)
|
||||||
|
sort.Sort(t.Labels)
|
||||||
sort.Sort(t.TemplateLabels)
|
sort.Sort(t.TemplateLabels)
|
||||||
sort.Sort(t.CommonAnnotations)
|
sort.Sort(t.CommonAnnotations)
|
||||||
sort.Sort(t.NameReference)
|
sort.Sort(t.NameReference)
|
||||||
@@ -114,12 +117,18 @@ func (t *TransformerConfig) AddSuffixFieldSpec(fs types.FieldSpec) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddLabelFieldSpec adds a FieldSpec to CommonLabels
|
// AddCommonLabelsFieldSpec adds a FieldSpec to CommonLabels
|
||||||
func (t *TransformerConfig) AddLabelFieldSpec(fs types.FieldSpec) (err error) {
|
func (t *TransformerConfig) AddCommonLabelsFieldSpec(fs types.FieldSpec) (err error) {
|
||||||
t.CommonLabels, err = t.CommonLabels.MergeOne(fs)
|
t.CommonLabels, err = t.CommonLabels.MergeOne(fs)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AddLabelsFieldSpec adds a FieldSpec to Labels
|
||||||
|
func (t *TransformerConfig) AddLabelsFieldSpec(fs types.FieldSpec) (err error) {
|
||||||
|
t.Labels, err = t.Labels.MergeOne(fs)
|
||||||
|
return err //nolint:wrapcheck
|
||||||
|
}
|
||||||
|
|
||||||
// AddAnnotationFieldSpec adds a FieldSpec to CommonAnnotations
|
// AddAnnotationFieldSpec adds a FieldSpec to CommonAnnotations
|
||||||
func (t *TransformerConfig) AddAnnotationFieldSpec(fs types.FieldSpec) (err error) {
|
func (t *TransformerConfig) AddAnnotationFieldSpec(fs types.FieldSpec) (err error) {
|
||||||
t.CommonAnnotations, err = t.CommonAnnotations.MergeOne(fs)
|
t.CommonAnnotations, err = t.CommonAnnotations.MergeOne(fs)
|
||||||
@@ -162,6 +171,10 @@ func (t *TransformerConfig) Merge(input *TransformerConfig) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.WrapPrefixf(err, "failed to merge CommonLabels fieldSpec")
|
return nil, errors.WrapPrefixf(err, "failed to merge CommonLabels fieldSpec")
|
||||||
}
|
}
|
||||||
|
merged.Labels, err = t.Labels.MergeAll(input.Labels)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WrapPrefixf(err, "failed to merge Labels fieldSpec")
|
||||||
|
}
|
||||||
merged.TemplateLabels, err = t.TemplateLabels.MergeAll(input.TemplateLabels)
|
merged.TemplateLabels, err = t.TemplateLabels.MergeAll(input.TemplateLabels)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.WrapPrefixf(err, "failed to merge TemplateLabels fieldSpec")
|
return nil, errors.WrapPrefixf(err, "failed to merge TemplateLabels fieldSpec")
|
||||||
|
|||||||
@@ -4,9 +4,10 @@
|
|||||||
package builtinconfig_test
|
package builtinconfig_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
. "sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
|
. "sigs.k8s.io/kustomize/api/internal/plugins/builtinconfig"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kyaml/resid"
|
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||||
@@ -35,13 +36,8 @@ func TestAddNamereferenceFieldSpec(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := cfg.AddNamereferenceFieldSpec(nbrs)
|
require.NoError(t, cfg.AddNamereferenceFieldSpec(nbrs))
|
||||||
if err != nil {
|
require.Len(t, cfg.NameReference, 1, "failed to add namereference FieldSpec")
|
||||||
t.Fatalf("unexpected err: %v", err)
|
|
||||||
}
|
|
||||||
if len(cfg.NameReference) != 1 {
|
|
||||||
t.Fatal("failed to add namereference FieldSpec")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAddFieldSpecs(t *testing.T) {
|
func TestAddFieldSpecs(t *testing.T) {
|
||||||
@@ -53,34 +49,14 @@ func TestAddFieldSpecs(t *testing.T) {
|
|||||||
CreateIfNotPresent: true,
|
CreateIfNotPresent: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := cfg.AddPrefixFieldSpec(fieldSpec)
|
require.NoError(t, cfg.AddPrefixFieldSpec(fieldSpec))
|
||||||
if err != nil {
|
require.Len(t, cfg.NamePrefix, 1, "failed to add nameprefix FieldSpec")
|
||||||
t.Fatalf("unexpected err: %v", err)
|
require.NoError(t, cfg.AddSuffixFieldSpec(fieldSpec))
|
||||||
}
|
require.Len(t, cfg.NameSuffix, 1, "failed to add namesuffix FieldSpec")
|
||||||
if len(cfg.NamePrefix) != 1 {
|
require.NoError(t, cfg.AddCommonLabelsFieldSpec(fieldSpec))
|
||||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
require.Len(t, cfg.CommonLabels, 1, "failed to add labels FieldSpec")
|
||||||
}
|
require.NoError(t, cfg.AddAnnotationFieldSpec(fieldSpec))
|
||||||
err = cfg.AddSuffixFieldSpec(fieldSpec)
|
require.Len(t, cfg.CommonAnnotations, 1, "failed to add nameprefix FieldSpec")
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected err: %v", err)
|
|
||||||
}
|
|
||||||
if len(cfg.NameSuffix) != 1 {
|
|
||||||
t.Fatalf("failed to add namesuffix FieldSpec")
|
|
||||||
}
|
|
||||||
err = cfg.AddLabelFieldSpec(fieldSpec)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected err: %v", err)
|
|
||||||
}
|
|
||||||
if len(cfg.CommonLabels) != 1 {
|
|
||||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
|
||||||
}
|
|
||||||
err = cfg.AddAnnotationFieldSpec(fieldSpec)
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("unexpected err: %v", err)
|
|
||||||
}
|
|
||||||
if len(cfg.CommonAnnotations) != 1 {
|
|
||||||
t.Fatalf("failed to add nameprefix FieldSpec")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMerge(t *testing.T) {
|
func TestMerge(t *testing.T) {
|
||||||
@@ -127,51 +103,43 @@ func TestMerge(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
cfga := &TransformerConfig{}
|
cfga := &TransformerConfig{}
|
||||||
cfga.AddNamereferenceFieldSpec(nameReference[0])
|
require.NoError(t, cfga.AddNamereferenceFieldSpec(nameReference[0]))
|
||||||
cfga.AddPrefixFieldSpec(fieldSpecs[0])
|
require.NoError(t, cfga.AddPrefixFieldSpec(fieldSpecs[0]))
|
||||||
cfga.AddSuffixFieldSpec(fieldSpecs[0])
|
require.NoError(t, cfga.AddSuffixFieldSpec(fieldSpecs[0]))
|
||||||
|
require.NoError(t, cfga.AddCommonLabelsFieldSpec(fieldSpecs[0]))
|
||||||
|
require.NoError(t, cfga.AddLabelsFieldSpec(fieldSpecs[0]))
|
||||||
|
|
||||||
cfgb := &TransformerConfig{}
|
cfgb := &TransformerConfig{}
|
||||||
cfgb.AddNamereferenceFieldSpec(nameReference[1])
|
require.NoError(t, cfgb.AddNamereferenceFieldSpec(nameReference[1]))
|
||||||
cfgb.AddPrefixFieldSpec(fieldSpecs[1])
|
require.NoError(t, cfgb.AddPrefixFieldSpec(fieldSpecs[1]))
|
||||||
cfga.AddSuffixFieldSpec(fieldSpecs[1])
|
require.NoError(t, cfgb.AddSuffixFieldSpec(fieldSpecs[1]))
|
||||||
|
require.NoError(t, cfgb.AddCommonLabelsFieldSpec(fieldSpecs[1]))
|
||||||
|
require.NoError(t, cfgb.AddLabelsFieldSpec(fieldSpecs[1]))
|
||||||
|
|
||||||
actual, err := cfga.Merge(cfgb)
|
actual, err := cfga.Merge(cfgb)
|
||||||
if err != nil {
|
require.NoError(t, err)
|
||||||
t.Fatalf("unexpected err: %v", err)
|
require.Len(t, actual.NamePrefix, 2, "merge failed for namePrefix FieldSpec")
|
||||||
}
|
require.Len(t, actual.NameSuffix, 2, "merge failed for nameSuffix FieldSpec")
|
||||||
|
require.Len(t, actual.NameReference, 1, "merge failed for nameReference FieldSpec")
|
||||||
if len(actual.NamePrefix) != 2 {
|
require.Len(t, actual.Labels, 2, "merge failed for labels FieldSpec")
|
||||||
t.Fatal("merge failed for namePrefix FieldSpec")
|
require.Len(t, actual.CommonLabels, 2, "merge failed for commonLabels FieldSpec")
|
||||||
}
|
|
||||||
|
|
||||||
if len(actual.NameSuffix) != 2 {
|
|
||||||
t.Fatal("merge failed for nameSuffix FieldSpec")
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(actual.NameReference) != 1 {
|
|
||||||
t.Fatal("merge failed for namereference FieldSpec")
|
|
||||||
}
|
|
||||||
|
|
||||||
expected := &TransformerConfig{}
|
expected := &TransformerConfig{}
|
||||||
expected.AddNamereferenceFieldSpec(nameReference[0])
|
require.NoError(t, expected.AddNamereferenceFieldSpec(nameReference[0]))
|
||||||
expected.AddNamereferenceFieldSpec(nameReference[1])
|
require.NoError(t, expected.AddNamereferenceFieldSpec(nameReference[1]))
|
||||||
expected.AddPrefixFieldSpec(fieldSpecs[0])
|
require.NoError(t, expected.AddPrefixFieldSpec(fieldSpecs[0]))
|
||||||
expected.AddPrefixFieldSpec(fieldSpecs[1])
|
require.NoError(t, expected.AddPrefixFieldSpec(fieldSpecs[1]))
|
||||||
expected.AddSuffixFieldSpec(fieldSpecs[0])
|
require.NoError(t, expected.AddSuffixFieldSpec(fieldSpecs[0]))
|
||||||
expected.AddSuffixFieldSpec(fieldSpecs[1])
|
require.NoError(t, expected.AddSuffixFieldSpec(fieldSpecs[1]))
|
||||||
|
require.NoError(t, expected.AddCommonLabelsFieldSpec(fieldSpecs[0]))
|
||||||
if !reflect.DeepEqual(actual, expected) {
|
require.NoError(t, expected.AddCommonLabelsFieldSpec(fieldSpecs[1]))
|
||||||
t.Fatalf("expected: %v\n but got: %v\n", expected, actual)
|
require.NoError(t, expected.AddLabelsFieldSpec(fieldSpecs[0]))
|
||||||
}
|
require.NoError(t, expected.AddLabelsFieldSpec(fieldSpecs[1]))
|
||||||
|
require.Equal(t, expected, actual)
|
||||||
|
|
||||||
actual, err = cfga.Merge(nil)
|
actual, err = cfga.Merge(nil)
|
||||||
if err != nil {
|
require.NoError(t, err)
|
||||||
t.Fatalf("unexpected err: %v", err)
|
require.Equal(t, cfga, actual)
|
||||||
}
|
|
||||||
if !reflect.DeepEqual(actual, cfga) {
|
|
||||||
t.Fatalf("expected: %v\n but got: %v\n", cfga, actual)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMakeDefaultConfig_mutation(t *testing.T) {
|
func TestMakeDefaultConfig_mutation(t *testing.T) {
|
||||||
@@ -182,9 +150,7 @@ func TestMakeDefaultConfig_mutation(t *testing.T) {
|
|||||||
a.NameReference = a.NameReference[:1]
|
a.NameReference = a.NameReference[:1]
|
||||||
|
|
||||||
clean := MakeDefaultConfig()
|
clean := MakeDefaultConfig()
|
||||||
if clean.NameReference[0].Kind == "mutated" {
|
assert.NotEqualf(t, "mutated", clean.NameReference[0].Kind, "MakeDefaultConfig() did not return a clean copy: %+v", clean.NameReference)
|
||||||
t.Errorf("MakeDefaultConfig() did not return a clean copy: %+v", clean.NameReference)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkMakeDefaultConfig(b *testing.B) {
|
func BenchmarkMakeDefaultConfig(b *testing.B) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package execplugin
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
@@ -21,6 +22,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
tmpConfigFilePrefix = "kust-plugin-config-"
|
tmpConfigFilePrefix = "kust-plugin-config-"
|
||||||
|
maxArgStringLength = 131071
|
||||||
)
|
)
|
||||||
|
|
||||||
// ExecPlugin record the name and args of an executable
|
// ExecPlugin record the name and args of an executable
|
||||||
@@ -169,23 +171,35 @@ func (p *ExecPlugin) invokePlugin(input []byte) ([]byte, error) {
|
|||||||
p.path, append([]string{f.Name()}, p.args...)...)
|
p.path, append([]string{f.Name()}, p.args...)...)
|
||||||
cmd.Env = p.getEnv()
|
cmd.Env = p.getEnv()
|
||||||
cmd.Stdin = bytes.NewReader(input)
|
cmd.Stdin = bytes.NewReader(input)
|
||||||
cmd.Stderr = os.Stderr
|
var stdErr bytes.Buffer
|
||||||
|
cmd.Stderr = &stdErr
|
||||||
if _, err := os.Stat(p.h.Loader().Root()); err == nil {
|
if _, err := os.Stat(p.h.Loader().Root()); err == nil {
|
||||||
cmd.Dir = p.h.Loader().Root()
|
cmd.Dir = p.h.Loader().Root()
|
||||||
}
|
}
|
||||||
result, err := cmd.Output()
|
result, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.WrapPrefixf(
|
return nil, errors.WrapPrefixf(
|
||||||
err, "failure in plugin configured via %s; %v",
|
fmt.Errorf("failure in plugin configured via %s; %w",
|
||||||
f.Name(), err.Error())
|
f.Name(), err), stdErr.String())
|
||||||
}
|
}
|
||||||
return result, os.Remove(f.Name())
|
return result, os.Remove(f.Name())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *ExecPlugin) getEnv() []string {
|
func (p *ExecPlugin) getEnv() []string {
|
||||||
env := os.Environ()
|
env := os.Environ()
|
||||||
env = append(env,
|
pluginConfigString := "KUSTOMIZE_PLUGIN_CONFIG_STRING=" + string(p.cfg)
|
||||||
"KUSTOMIZE_PLUGIN_CONFIG_STRING="+string(p.cfg),
|
if len(pluginConfigString) <= maxArgStringLength {
|
||||||
"KUSTOMIZE_PLUGIN_CONFIG_ROOT="+p.h.Loader().Root())
|
env = append(env, pluginConfigString)
|
||||||
|
} else {
|
||||||
|
log.Printf("KUSTOMIZE_PLUGIN_CONFIG_STRING exceeds hard limit of %d characters, the environment variable "+
|
||||||
|
"will be omitted", maxArgStringLength)
|
||||||
|
}
|
||||||
|
pluginConfigRoot := "KUSTOMIZE_PLUGIN_CONFIG_ROOT=" + p.h.Loader().Root()
|
||||||
|
if len(pluginConfigRoot) <= maxArgStringLength {
|
||||||
|
env = append(env, pluginConfigRoot)
|
||||||
|
} else {
|
||||||
|
log.Printf("KUSTOMIZE_PLUGIN_CONFIG_ROOT exceeds hard limit of %d characters, the environment variable "+
|
||||||
|
"will be omitted", maxArgStringLength)
|
||||||
|
}
|
||||||
return env
|
return env
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,12 @@ import (
|
|||||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
expectedLargeConfigMap = `{"apiVersion":"v1","data":{"password":"password","username":"user"},"kind":"ConfigMap",` +
|
||||||
|
`"metadata":{"annotations":{"internal.config.kubernetes.io/generatorBehavior":"unspecified",` +
|
||||||
|
`"internal.config.kubernetes.io/needsHashSuffix":"enabled"},"name":"example-configmap-test"}}`
|
||||||
|
)
|
||||||
|
|
||||||
func TestExecPluginConfig(t *testing.T) {
|
func TestExecPluginConfig(t *testing.T) {
|
||||||
fSys := filesys.MakeFsInMemory()
|
fSys := filesys.MakeFsInMemory()
|
||||||
err := fSys.WriteFile("sed-input.txt", []byte(`
|
err := fSys.WriteFile("sed-input.txt", []byte(`
|
||||||
@@ -35,7 +41,7 @@ s/$BAR/bar baz/g
|
|||||||
}
|
}
|
||||||
pvd := provider.NewDefaultDepProvider()
|
pvd := provider.NewDefaultDepProvider()
|
||||||
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
||||||
pluginConfig := rf.RF().FromMap(
|
pluginConfig, err := rf.RF().FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "someteam.example.com/v1",
|
"apiVersion": "someteam.example.com/v1",
|
||||||
"kind": "SedTransformer",
|
"kind": "SedTransformer",
|
||||||
@@ -45,6 +51,9 @@ s/$BAR/bar baz/g
|
|||||||
"argsOneLiner": "one two 'foo bar'",
|
"argsOneLiner": "one two 'foo bar'",
|
||||||
"argsFromFile": "sed-input.txt",
|
"argsFromFile": "sed-input.txt",
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to writes the data to a file: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
pluginConfig.RemoveBuildAnnotations()
|
pluginConfig.RemoveBuildAnnotations()
|
||||||
pc := types.DisabledPluginConfig()
|
pc := types.DisabledPluginConfig()
|
||||||
@@ -125,3 +134,104 @@ func TestExecPlugin_ErrIfNotExecutable(t *testing.T) {
|
|||||||
t.Fatalf("unexpected err: %v", err)
|
t.Fatalf("unexpected err: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestExecPluginLarge loads PluginConfigs of various (large) sizes. It tests if the env variable is kept below the
|
||||||
|
// maximum of 131072 bytes.
|
||||||
|
func TestExecPluginLarge(t *testing.T) {
|
||||||
|
// Skip this test on windows.
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
t.Skipf("always returns nil on Windows")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add executable plugin.
|
||||||
|
srcRoot, err := utils.DeterminePluginSrcRoot(filesys.MakeFsOnDisk())
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
executablePlugin := filepath.Join(
|
||||||
|
srcRoot, "someteam.example.com", "v1", "bashedconfigmap", "BashedConfigMap")
|
||||||
|
p := NewExecPlugin(executablePlugin)
|
||||||
|
err = p.ErrIfNotExecutable()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a fake filesystem.
|
||||||
|
fSys := filesys.MakeFsInMemory()
|
||||||
|
|
||||||
|
// Load plugin config.
|
||||||
|
ldr, err := fLdr.NewLoader(
|
||||||
|
fLdr.RestrictionRootOnly, filesys.Separator, fSys)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
pvd := provider.NewDefaultDepProvider()
|
||||||
|
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
||||||
|
pc := types.DisabledPluginConfig()
|
||||||
|
|
||||||
|
// Test for various lengths. 131071 is the max length that we can have for any given env var in Bytes.
|
||||||
|
tcs := []struct {
|
||||||
|
length int
|
||||||
|
char rune
|
||||||
|
}{
|
||||||
|
{1000, 'a'},
|
||||||
|
{131071, 'a'},
|
||||||
|
{131072, 'a'},
|
||||||
|
{200000, 'a'},
|
||||||
|
{131071, '安'},
|
||||||
|
{131074, '安'},
|
||||||
|
}
|
||||||
|
for _, tc := range tcs {
|
||||||
|
t.Logf("Testing with an env var length of %d and character %c", tc.length, tc.char)
|
||||||
|
pluginConfig, err := rf.RF().FromBytes(buildLargePluginConfig(tc.length, tc.char))
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
yaml, err := pluginConfig.AsYAML()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
err = p.Config(resmap.NewPluginHelpers(ldr, pvd.GetFieldValidator(), rf, pc), yaml)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
resMap, err := p.Generate()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
rNodeSlices := resMap.ToRNodeSlice()
|
||||||
|
for _, rNodeSlice := range rNodeSlices {
|
||||||
|
json, err := rNodeSlice.MarshalJSON()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("unexpected err: %v", err)
|
||||||
|
}
|
||||||
|
if string(json) != expectedLargeConfigMap {
|
||||||
|
t.Fatalf("expected generated JSON to match %q, but got %q instead",
|
||||||
|
expectedLargeConfigMap, string(json))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// buildLargePluginConfig builds a plugin configuration of length: length - len("KUSTOMIZE_PLUGIN_CONFIG_STRING=")
|
||||||
|
// This allows us to create an environment variable KUSTOMIZE_PLUGIN_CONFIG_STRING=<plugin content> with the exact
|
||||||
|
// length that's provided in the length parameter. Used as a helper for TestExecPluginLarge.
|
||||||
|
func buildLargePluginConfig(length int, char rune) []byte {
|
||||||
|
length -= len("KUSTOMIZE_PLUGIN_CONFIG_STRING=")
|
||||||
|
|
||||||
|
var sb strings.Builder
|
||||||
|
sb.WriteString("apiVersion: someteam.example.com/v1\n")
|
||||||
|
sb.WriteString("kind: BashedConfigMap\n")
|
||||||
|
sb.WriteString("metadata:\n")
|
||||||
|
sb.WriteString(" name: some-random-name\n")
|
||||||
|
sb.WriteString("argsOneLiner: \"user password\"\n")
|
||||||
|
sb.WriteString("customArg: ")
|
||||||
|
|
||||||
|
// Now, fill up parameter customArg: until we reach the desired length. Account for the fact that runes can be
|
||||||
|
// 1 to 4 Bytes each.
|
||||||
|
upperBound := length - sb.Len()
|
||||||
|
for i := 0; i < upperBound-len(string(char)); i += len(string(char)) {
|
||||||
|
sb.WriteRune(char)
|
||||||
|
}
|
||||||
|
return []byte(sb.String())
|
||||||
|
}
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ func NewFnPlugin(o *types.FnPluginLoadingOptions) *FnPlugin {
|
|||||||
runFns: runfn.RunFns{
|
runFns: runfn.RunFns{
|
||||||
Functions: []*yaml.RNode{},
|
Functions: []*yaml.RNode{},
|
||||||
Network: o.Network,
|
Network: o.Network,
|
||||||
EnableStarlark: o.EnableStar,
|
|
||||||
EnableExec: o.EnableExec,
|
EnableExec: o.EnableExec,
|
||||||
StorageMounts: toStorageMounts(o.Mounts),
|
StorageMounts: toStorageMounts(o.Mounts),
|
||||||
Env: o.Env,
|
Env: o.Env,
|
||||||
|
|||||||
62
api/internal/plugins/loader/load_go_plugin.go
Normal file
62
api/internal/plugins/loader/load_go_plugin.go
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
// Copyright 2024 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
//go:build !kustomize_disable_go_plugin_support
|
||||||
|
|
||||||
|
package loader
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"log"
|
||||||
|
"plugin"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
||||||
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/errors"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||||
|
)
|
||||||
|
|
||||||
|
// registry is a means to avoid trying to load the same .so file
|
||||||
|
// into memory more than once, which results in an error.
|
||||||
|
// Each test makes its own loader, and tries to load its own plugins,
|
||||||
|
// but the loaded .so files are in shared memory, so one will get
|
||||||
|
// "this plugin already loaded" errors if the registry is maintained
|
||||||
|
// as a Loader instance variable. So make it a package variable.
|
||||||
|
var registry = make(map[string]resmap.Configurable) //nolint:gochecknoglobals
|
||||||
|
|
||||||
|
func copyPlugin(c resmap.Configurable) resmap.Configurable {
|
||||||
|
indirect := reflect.Indirect(reflect.ValueOf(c))
|
||||||
|
newIndirect := reflect.New(indirect.Type())
|
||||||
|
newIndirect.Elem().Set(reflect.ValueOf(indirect.Interface()))
|
||||||
|
newNamed := newIndirect.Interface()
|
||||||
|
return newNamed.(resmap.Configurable) //nolint:forcetypeassert
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *Loader) loadGoPlugin(id resid.ResId, absPath string) (resmap.Configurable, error) {
|
||||||
|
regId := relativePluginPath(id)
|
||||||
|
if c, ok := registry[regId]; ok {
|
||||||
|
return copyPlugin(c), nil
|
||||||
|
}
|
||||||
|
if !utils.FileExists(absPath) {
|
||||||
|
return nil, fmt.Errorf(
|
||||||
|
"expected file with Go object code at: %s", absPath)
|
||||||
|
}
|
||||||
|
log.Printf("Attempting plugin load from %q", absPath)
|
||||||
|
p, err := plugin.Open(absPath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WrapPrefixf(err, "plugin %s fails to load", absPath)
|
||||||
|
}
|
||||||
|
symbol, err := p.Lookup(konfig.PluginSymbol)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.WrapPrefixf(
|
||||||
|
err, "plugin %s doesn't have symbol %s",
|
||||||
|
regId, konfig.PluginSymbol)
|
||||||
|
}
|
||||||
|
c, ok := symbol.(resmap.Configurable)
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("plugin %q not configurable", regId)
|
||||||
|
}
|
||||||
|
registry[regId] = c
|
||||||
|
return copyPlugin(c), nil
|
||||||
|
}
|
||||||
25
api/internal/plugins/loader/load_go_plugin_disabled.go
Normal file
25
api/internal/plugins/loader/load_go_plugin_disabled.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2024 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
// The build tag "kustomize_disable_go_plugin_support" is used to deactivate the
|
||||||
|
// kustomize API's dependency on the "plugins" package. This is beneficial for
|
||||||
|
// applications that need to embed it but do not have requirements for dynamic
|
||||||
|
// Go plugins.
|
||||||
|
// Including plugins as a dependency can lead to an increase in binary size due
|
||||||
|
// to the population of ELF's sections such as .dynsym and .dynstr.
|
||||||
|
// By utilizing this flag, applications have the flexibility to exclude the
|
||||||
|
// import if they do not require support for dynamic Go plugins.
|
||||||
|
//go:build kustomize_disable_go_plugin_support
|
||||||
|
|
||||||
|
package loader
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
|
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (l *Loader) loadGoPlugin(_ resid.ResId, _ string) (resmap.Configurable, error) {
|
||||||
|
return nil, fmt.Errorf("plugin load is disabled")
|
||||||
|
}
|
||||||
@@ -5,18 +5,14 @@ package loader
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"plugin"
|
|
||||||
"reflect"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers"
|
"sigs.k8s.io/kustomize/api/internal/plugins/builtinhelpers"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/execplugin"
|
"sigs.k8s.io/kustomize/api/internal/plugins/execplugin"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/fnplugin"
|
"sigs.k8s.io/kustomize/api/internal/plugins/fnplugin"
|
||||||
"sigs.k8s.io/kustomize/api/internal/plugins/utils"
|
|
||||||
"sigs.k8s.io/kustomize/api/konfig"
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/resource"
|
"sigs.k8s.io/kustomize/api/resource"
|
||||||
@@ -287,46 +283,3 @@ func (l *Loader) loadExecOrGoPlugin(resId resid.ResId) (resmap.Configurable, err
|
|||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// registry is a means to avoid trying to load the same .so file
|
|
||||||
// into memory more than once, which results in an error.
|
|
||||||
// Each test makes its own loader, and tries to load its own plugins,
|
|
||||||
// but the loaded .so files are in shared memory, so one will get
|
|
||||||
// "this plugin already loaded" errors if the registry is maintained
|
|
||||||
// as a Loader instance variable. So make it a package variable.
|
|
||||||
var registry = make(map[string]resmap.Configurable)
|
|
||||||
|
|
||||||
func (l *Loader) loadGoPlugin(id resid.ResId, absPath string) (resmap.Configurable, error) {
|
|
||||||
regId := relativePluginPath(id)
|
|
||||||
if c, ok := registry[regId]; ok {
|
|
||||||
return copyPlugin(c), nil
|
|
||||||
}
|
|
||||||
if !utils.FileExists(absPath) {
|
|
||||||
return nil, fmt.Errorf(
|
|
||||||
"expected file with Go object code at: %s", absPath)
|
|
||||||
}
|
|
||||||
log.Printf("Attempting plugin load from '%s'", absPath)
|
|
||||||
p, err := plugin.Open(absPath)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.WrapPrefixf(err, "plugin %s fails to load", absPath)
|
|
||||||
}
|
|
||||||
symbol, err := p.Lookup(konfig.PluginSymbol)
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.WrapPrefixf(
|
|
||||||
err, "plugin %s doesn't have symbol %s",
|
|
||||||
regId, konfig.PluginSymbol)
|
|
||||||
}
|
|
||||||
c, ok := symbol.(resmap.Configurable)
|
|
||||||
if !ok {
|
|
||||||
return nil, fmt.Errorf("plugin '%s' not configurable", regId)
|
|
||||||
}
|
|
||||||
registry[regId] = c
|
|
||||||
return copyPlugin(c), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func copyPlugin(c resmap.Configurable) resmap.Configurable {
|
|
||||||
indirect := reflect.Indirect(reflect.ValueOf(c))
|
|
||||||
newIndirect := reflect.New(indirect.Type())
|
|
||||||
newIndirect.Elem().Set(reflect.ValueOf(indirect.Interface()))
|
|
||||||
newNamed := newIndirect.Interface()
|
|
||||||
return newNamed.(resmap.Configurable)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/konfig"
|
"sigs.k8s.io/kustomize/api/konfig"
|
||||||
"sigs.k8s.io/kustomize/api/provider"
|
"sigs.k8s.io/kustomize/api/provider"
|
||||||
@@ -33,11 +32,14 @@ func TestDeterminePluginSrcRoot(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
|
func makeConfigMap(rf *resource.Factory, name, behavior string, hashValue *string) *resource.Resource {
|
||||||
r := rf.FromMap(map[string]interface{}{
|
r, err := rf.FromMap(map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
"metadata": map[string]interface{}{"name": name},
|
"metadata": map[string]interface{}{"name": name},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
annotations := map[string]string{}
|
annotations := map[string]string{}
|
||||||
if behavior != "" {
|
if behavior != "" {
|
||||||
annotations[BehaviorAnnotation] = behavior
|
annotations[BehaviorAnnotation] = behavior
|
||||||
@@ -97,8 +99,8 @@ func TestUpdateResourceOptions(t *testing.T) {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
}
|
}
|
||||||
actual, err := UpdateResourceOptions(in)
|
actual, err := UpdateResourceOptions(in)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, expected.ErrorIfNotEqualLists(actual))
|
require.NoError(t, expected.ErrorIfNotEqualLists(actual))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestUpdateResourceOptionsWithInvalidHashAnnotationValues(t *testing.T) {
|
func TestUpdateResourceOptionsWithInvalidHashAnnotationValues(t *testing.T) {
|
||||||
|
|||||||
@@ -425,7 +425,14 @@ func (kt *KustTarget) accumulateResources(
|
|||||||
}
|
}
|
||||||
ldr, err := kt.ldr.New(path)
|
ldr, err := kt.ldr.New(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if kusterr.IsMalformedYAMLError(errF) { // Some error occurred while tyring to decode YAML file
|
// If accumulateFile found malformed YAML and there was a failure
|
||||||
|
// loading the resource as a base, then the resource is likely a
|
||||||
|
// file. The loader failure message is unnecessary, and could be
|
||||||
|
// confusing. Report only the file load error.
|
||||||
|
//
|
||||||
|
// However, a loader timeout implies there is a git repo at the
|
||||||
|
// path. In that case, both errors could be important.
|
||||||
|
if kusterr.IsMalformedYAMLError(errF) && !utils.IsErrTimeout(err) {
|
||||||
return nil, errF
|
return nil, errF
|
||||||
}
|
}
|
||||||
return nil, errors.WrapPrefixf(
|
return nil, errors.WrapPrefixf(
|
||||||
@@ -442,9 +449,6 @@ func (kt *KustTarget) accumulateResources(
|
|||||||
ra, err = kt.accumulateDirectory(ra, ldr, false)
|
ra, err = kt.accumulateDirectory(ra, ldr, false)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if kusterr.IsMalformedYAMLError(errF) { // Some error occurred while tyring to decode YAML file
|
|
||||||
return nil, errF
|
|
||||||
}
|
|
||||||
return nil, errors.WrapPrefixf(
|
return nil, errors.WrapPrefixf(
|
||||||
err, "accumulation err='%s'", errF.Error())
|
err, "accumulation err='%s'", errF.Error())
|
||||||
}
|
}
|
||||||
@@ -453,7 +457,7 @@ func (kt *KustTarget) accumulateResources(
|
|||||||
return ra, nil
|
return ra, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// accumulateResources fills the given resourceAccumulator
|
// accumulateComponents fills the given resourceAccumulator
|
||||||
// with resources read from the given list of paths.
|
// with resources read from the given list of paths.
|
||||||
func (kt *KustTarget) accumulateComponents(
|
func (kt *KustTarget) accumulateComponents(
|
||||||
ra *accumulator.ResAccumulator, paths []string) (*accumulator.ResAccumulator, error) {
|
ra *accumulator.ResAccumulator, paths []string) (*accumulator.ResAccumulator, error) {
|
||||||
|
|||||||
@@ -275,13 +275,25 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
|||||||
if len(kt.kustomization.Labels) == 0 && len(kt.kustomization.CommonLabels) == 0 {
|
if len(kt.kustomization.Labels) == 0 && len(kt.kustomization.CommonLabels) == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type labelStruct struct {
|
||||||
|
Labels map[string]string
|
||||||
|
FieldSpecs []types.FieldSpec
|
||||||
|
}
|
||||||
|
|
||||||
for _, label := range kt.kustomization.Labels {
|
for _, label := range kt.kustomization.Labels {
|
||||||
var c struct {
|
var c labelStruct
|
||||||
Labels map[string]string
|
|
||||||
FieldSpecs []types.FieldSpec
|
|
||||||
}
|
|
||||||
c.Labels = label.Pairs
|
c.Labels = label.Pairs
|
||||||
fss := types.FsSlice(label.FieldSpecs)
|
fss := types.FsSlice(label.FieldSpecs)
|
||||||
|
|
||||||
|
// merge labels specified in the label section of transformer configs
|
||||||
|
// these apply to selectors and templates
|
||||||
|
fss, err := fss.MergeAll(tc.Labels)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to merge labels: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
// merge the custom fieldSpecs with the default
|
// merge the custom fieldSpecs with the default
|
||||||
if label.IncludeSelectors {
|
if label.IncludeSelectors {
|
||||||
fss, err = fss.MergeAll(tc.CommonLabels)
|
fss, err = fss.MergeAll(tc.CommonLabels)
|
||||||
@@ -297,7 +309,7 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
|||||||
fss, err = fss.MergeOne(types.FieldSpec{Path: "metadata/labels", CreateIfNotPresent: true})
|
fss, err = fss.MergeOne(types.FieldSpec{Path: "metadata/labels", CreateIfNotPresent: true})
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("failed to merge labels: %w", err)
|
||||||
}
|
}
|
||||||
c.FieldSpecs = fss
|
c.FieldSpecs = fss
|
||||||
p := f()
|
p := f()
|
||||||
@@ -307,10 +319,9 @@ var transformerConfigurators = map[builtinhelpers.BuiltinPluginType]func(
|
|||||||
}
|
}
|
||||||
result = append(result, p)
|
result = append(result, p)
|
||||||
}
|
}
|
||||||
var c struct {
|
|
||||||
Labels map[string]string
|
var c labelStruct
|
||||||
FieldSpecs []types.FieldSpec
|
|
||||||
}
|
|
||||||
c.Labels = kt.kustomization.CommonLabels
|
c.Labels = kt.kustomization.CommonLabels
|
||||||
c.FieldSpecs = tc.CommonLabels
|
c.FieldSpecs = tc.CommonLabels
|
||||||
p := f()
|
p := f()
|
||||||
|
|||||||
@@ -6,13 +6,17 @@ package target_test
|
|||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
. "sigs.k8s.io/kustomize/api/internal/target"
|
. "sigs.k8s.io/kustomize/api/internal/target"
|
||||||
|
"sigs.k8s.io/kustomize/api/internal/utils"
|
||||||
"sigs.k8s.io/kustomize/api/pkg/loader"
|
"sigs.k8s.io/kustomize/api/pkg/loader"
|
||||||
"sigs.k8s.io/kustomize/api/provider"
|
"sigs.k8s.io/kustomize/api/provider"
|
||||||
"sigs.k8s.io/kustomize/api/resmap"
|
"sigs.k8s.io/kustomize/api/resmap"
|
||||||
@@ -189,13 +193,67 @@ metadata:
|
|||||||
|
|
||||||
pvd := provider.NewDefaultDepProvider()
|
pvd := provider.NewDefaultDepProvider()
|
||||||
resFactory := pvd.GetResourceFactory()
|
resFactory := pvd.GetResourceFactory()
|
||||||
|
name0 := "dply1"
|
||||||
|
|
||||||
resources := []*resource.Resource{
|
r0, err := resFactory.FromMapWithName(name0, map[string]interface{}{
|
||||||
resFactory.FromMapWithName("dply1", map[string]interface{}{
|
"apiVersion": "apps/v1",
|
||||||
"apiVersion": "apps/v1",
|
"kind": "Deployment",
|
||||||
"kind": "Deployment",
|
"metadata": map[string]interface{}{
|
||||||
|
"name": "foo-dply1-bar",
|
||||||
|
"namespace": "ns1",
|
||||||
|
"labels": map[string]interface{}{
|
||||||
|
"app": "nginx",
|
||||||
|
},
|
||||||
|
"annotations": map[string]interface{}{
|
||||||
|
"note": "This is a test annotation",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"spec": map[string]interface{}{
|
||||||
|
"replica": "3",
|
||||||
|
"selector": map[string]interface{}{
|
||||||
|
"matchLabels": map[string]interface{}{
|
||||||
|
"app": "nginx",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"template": map[string]interface{}{
|
||||||
|
"metadata": map[string]interface{}{
|
||||||
|
"annotations": map[string]interface{}{
|
||||||
|
"note": "This is a test annotation",
|
||||||
|
},
|
||||||
|
"labels": map[string]interface{}{
|
||||||
|
"app": "nginx",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get instance with given name %v: %v", name0, err)
|
||||||
|
}
|
||||||
|
name1 := "ns1"
|
||||||
|
r1, err := resFactory.FromMapWithName(name1, map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "Namespace",
|
||||||
|
"metadata": map[string]interface{}{
|
||||||
|
"name": "ns1",
|
||||||
|
"labels": map[string]interface{}{
|
||||||
|
"app": "nginx",
|
||||||
|
},
|
||||||
|
"annotations": map[string]interface{}{
|
||||||
|
"note": "This is a test annotation",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get instance with given name %v: %v", name1, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
r2, _ := resFactory.FromMapWithName("literalConfigMap",
|
||||||
|
map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "ConfigMap",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "foo-dply1-bar",
|
"name": "foo-literalConfigMap-bar-g5f6t456f5",
|
||||||
"namespace": "ns1",
|
"namespace": "ns1",
|
||||||
"labels": map[string]interface{}{
|
"labels": map[string]interface{}{
|
||||||
"app": "nginx",
|
"app": "nginx",
|
||||||
@@ -204,30 +262,20 @@ metadata:
|
|||||||
"note": "This is a test annotation",
|
"note": "This is a test annotation",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"spec": map[string]interface{}{
|
"data": map[string]interface{}{
|
||||||
"replica": "3",
|
"DB_USERNAME": "admin",
|
||||||
"selector": map[string]interface{}{
|
"DB_PASSWORD": "somepw",
|
||||||
"matchLabels": map[string]interface{}{
|
|
||||||
"app": "nginx",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"template": map[string]interface{}{
|
|
||||||
"metadata": map[string]interface{}{
|
|
||||||
"annotations": map[string]interface{}{
|
|
||||||
"note": "This is a test annotation",
|
|
||||||
},
|
|
||||||
"labels": map[string]interface{}{
|
|
||||||
"app": "nginx",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}),
|
})
|
||||||
resFactory.FromMapWithName("ns1", map[string]interface{}{
|
|
||||||
|
name2 := "secret"
|
||||||
|
r3, err := resFactory.FromMapWithName(name2,
|
||||||
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "Namespace",
|
"kind": "Secret",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "ns1",
|
"name": "foo-secret-bar-82c2g5f8f6",
|
||||||
|
"namespace": "ns1",
|
||||||
"labels": map[string]interface{}{
|
"labels": map[string]interface{}{
|
||||||
"app": "nginx",
|
"app": "nginx",
|
||||||
},
|
},
|
||||||
@@ -235,65 +283,33 @@ metadata:
|
|||||||
"note": "This is a test annotation",
|
"note": "This is a test annotation",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
"type": ifc.SecretTypeOpaque,
|
||||||
resFactory.FromMapWithName("literalConfigMap",
|
"data": map[string]interface{}{
|
||||||
map[string]interface{}{
|
"DB_USERNAME": base64.StdEncoding.EncodeToString([]byte("admin")),
|
||||||
"apiVersion": "v1",
|
"DB_PASSWORD": base64.StdEncoding.EncodeToString([]byte("somepw")),
|
||||||
"kind": "ConfigMap",
|
},
|
||||||
"metadata": map[string]interface{}{
|
})
|
||||||
"name": "foo-literalConfigMap-bar-g5f6t456f5",
|
if err != nil {
|
||||||
"namespace": "ns1",
|
t.Fatalf("failed to get instance with given name %v: %v", name2, err)
|
||||||
"labels": map[string]interface{}{
|
|
||||||
"app": "nginx",
|
|
||||||
},
|
|
||||||
"annotations": map[string]interface{}{
|
|
||||||
"note": "This is a test annotation",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"data": map[string]interface{}{
|
|
||||||
"DB_USERNAME": "admin",
|
|
||||||
"DB_PASSWORD": "somepw",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
resFactory.FromMapWithName("secret",
|
|
||||||
map[string]interface{}{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"kind": "Secret",
|
|
||||||
"metadata": map[string]interface{}{
|
|
||||||
"name": "foo-secret-bar-82c2g5f8f6",
|
|
||||||
"namespace": "ns1",
|
|
||||||
"labels": map[string]interface{}{
|
|
||||||
"app": "nginx",
|
|
||||||
},
|
|
||||||
"annotations": map[string]interface{}{
|
|
||||||
"note": "This is a test annotation",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"type": ifc.SecretTypeOpaque,
|
|
||||||
"data": map[string]interface{}{
|
|
||||||
"DB_USERNAME": base64.StdEncoding.EncodeToString([]byte("admin")),
|
|
||||||
"DB_PASSWORD": base64.StdEncoding.EncodeToString([]byte("somepw")),
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resources := []*resource.Resource{r0, r1, r2, r3}
|
||||||
|
|
||||||
expected := resmap.New()
|
expected := resmap.New()
|
||||||
for _, r := range resources {
|
for _, r := range resources {
|
||||||
if err := expected.Append(r); err != nil {
|
require.NoError(t, expected.Append(r), "failed to append resource: %v")
|
||||||
t.Fatalf("unexpected error %v", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
expected.RemoveBuildAnnotations()
|
expected.RemoveBuildAnnotations()
|
||||||
expYaml, err := expected.AsYaml()
|
expYaml, err := expected.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
kt := makeKustTargetWithRf(t, th.GetFSys(), "/whatever", pvd)
|
kt := makeKustTargetWithRf(t, th.GetFSys(), "/whatever", pvd)
|
||||||
assert.NoError(t, kt.Load())
|
require.NoError(t, kt.Load())
|
||||||
actual, err := kt.MakeCustomizedResMap()
|
actual, err := kt.MakeCustomizedResMap()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
actual.RemoveBuildAnnotations()
|
actual.RemoveBuildAnnotations()
|
||||||
actYaml, err := actual.AsYaml()
|
actYaml, err := actual.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, string(expYaml), string(actYaml))
|
assert.Equal(t, string(expYaml), string(actYaml))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,19 +329,21 @@ configurations:
|
|||||||
th.WriteF("/merge-config/name-prefix-rules.yaml", `
|
th.WriteF("/merge-config/name-prefix-rules.yaml", `
|
||||||
namePrefix:
|
namePrefix:
|
||||||
- path: metadata/name
|
- path: metadata/name
|
||||||
apiVersion: v1
|
group: apps
|
||||||
|
version: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
- path: metadata/name
|
- path: metadata/name
|
||||||
apiVersion: v1
|
version: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
`)
|
`)
|
||||||
th.WriteF("/merge-config/name-suffix-rules.yaml", `
|
th.WriteF("/merge-config/name-suffix-rules.yaml", `
|
||||||
nameSuffix:
|
nameSuffix:
|
||||||
- path: metadata/name
|
- path: metadata/name
|
||||||
apiVersion: v1
|
version: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
- path: metadata/name
|
- path: metadata/name
|
||||||
apiVersion: v1
|
group: apps
|
||||||
|
version: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
`)
|
`)
|
||||||
th.WriteF("/merge-config/deployment.yaml", `
|
th.WriteF("/merge-config/deployment.yaml", `
|
||||||
@@ -350,31 +368,43 @@ metadata:
|
|||||||
pvd := provider.NewDefaultDepProvider()
|
pvd := provider.NewDefaultDepProvider()
|
||||||
resFactory := pvd.GetResourceFactory()
|
resFactory := pvd.GetResourceFactory()
|
||||||
|
|
||||||
resources := []*resource.Resource{
|
name0 := "deployment1"
|
||||||
resFactory.FromMapWithName("deployment1", map[string]interface{}{
|
r0, err0 := resFactory.FromMapWithName(name0, map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "foo-deployment1-bar",
|
"name": "foo-deployment1-bar",
|
||||||
"namespace": "ns1",
|
"namespace": "ns1",
|
||||||
},
|
},
|
||||||
}), resFactory.FromMapWithName("config", map[string]interface{}{
|
})
|
||||||
"apiVersion": "v1",
|
if err0 != nil {
|
||||||
"kind": "ConfigMap",
|
t.Fatalf("failed to get instance with given name %v: %v", name0, err0)
|
||||||
"metadata": map[string]interface{}{
|
|
||||||
"name": "config-bar",
|
|
||||||
"namespace": "ns1",
|
|
||||||
},
|
|
||||||
}), resFactory.FromMapWithName("secret", map[string]interface{}{
|
|
||||||
"apiVersion": "v1",
|
|
||||||
"kind": "Secret",
|
|
||||||
"metadata": map[string]interface{}{
|
|
||||||
"name": "foo-secret",
|
|
||||||
"namespace": "ns1",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
}
|
}
|
||||||
|
name1 := "config"
|
||||||
|
r1, err1 := resFactory.FromMapWithName(name1, map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "ConfigMap",
|
||||||
|
"metadata": map[string]interface{}{
|
||||||
|
"name": "config-bar",
|
||||||
|
"namespace": "ns1",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get instance with given name %v: %v", name1, err1)
|
||||||
|
}
|
||||||
|
name2 := "secret"
|
||||||
|
r2, err2 := resFactory.FromMapWithName(name2, map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "Secret",
|
||||||
|
"metadata": map[string]interface{}{
|
||||||
|
"name": "foo-secret",
|
||||||
|
"namespace": "ns1",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get instance with given name %v: %v", name2, err2)
|
||||||
|
}
|
||||||
|
var resources = []*resource.Resource{r0, r1, r2}
|
||||||
expected := resmap.New()
|
expected := resmap.New()
|
||||||
for _, r := range resources {
|
for _, r := range resources {
|
||||||
err := expected.Append(r)
|
err := expected.Append(r)
|
||||||
@@ -423,7 +453,7 @@ func TestDuplicateExternalGeneratorsForbidden(t *testing.T) {
|
|||||||
configPath: another_config.json
|
configPath: another_config.json
|
||||||
`)
|
`)
|
||||||
_, err := makeAndLoadKustTarget(t, th.GetFSys(), "/generator").AccumulateTarget()
|
_, err := makeAndLoadKustTarget(t, th.GetFSys(), "/generator").AccumulateTarget()
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "may not add resource with an already registered id: ManifestGenerator.v1.generators.example/ManifestGenerator")
|
assert.Contains(t, err.Error(), "may not add resource with an already registered id: ManifestGenerator.v1.generators.example/ManifestGenerator")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,6 +482,151 @@ func TestDuplicateExternalTransformersForbidden(t *testing.T) {
|
|||||||
value: 'fail'
|
value: 'fail'
|
||||||
`)
|
`)
|
||||||
_, err := makeAndLoadKustTarget(t, th.GetFSys(), "/transformer").AccumulateTarget()
|
_, err := makeAndLoadKustTarget(t, th.GetFSys(), "/transformer").AccumulateTarget()
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "may not add resource with an already registered id: ValueAnnotator.v1.transformers.example.co/notImportantHere")
|
assert.Contains(t, err.Error(), "may not add resource with an already registered id: ValueAnnotator.v1.transformers.example.co/notImportantHere")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestErrorMessageForMalformedYAML(t *testing.T) {
|
||||||
|
// These testcases verify behavior for the scenario described in
|
||||||
|
// https://github.com/kubernetes-sigs/kustomize/issues/5540 .
|
||||||
|
|
||||||
|
testcases := map[string]struct {
|
||||||
|
loaderNewReturnsError error
|
||||||
|
shouldShowLoadError bool
|
||||||
|
}{
|
||||||
|
"shouldShowLoadError": {
|
||||||
|
loaderNewReturnsError: utils.NewErrTimeOut(time.Second, "git init"),
|
||||||
|
shouldShowLoadError: true,
|
||||||
|
},
|
||||||
|
"shouldNotShowLoadError": {
|
||||||
|
loaderNewReturnsError: NewErrMissingKustomization("/should-fail/resources.yaml"),
|
||||||
|
shouldShowLoadError: false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteF("/should-fail/kustomization.yaml", `resources:
|
||||||
|
- resources.yaml
|
||||||
|
`)
|
||||||
|
th.WriteF("/should-fail/resources.yaml", `<!DOCTYPE html>
|
||||||
|
<html class="html-devise-layout ui-light-gray" lang="en">
|
||||||
|
<head prefix="og: http://ogp.me/ns#">
|
||||||
|
<meta charset="utf-8">
|
||||||
|
`)
|
||||||
|
|
||||||
|
for name, tc := range testcases {
|
||||||
|
t.Run(name, func(subT *testing.T) {
|
||||||
|
ldrWrapper := func(baseLoader ifc.Loader) ifc.Loader {
|
||||||
|
return loaderNewThrowsError{
|
||||||
|
baseLoader: baseLoader,
|
||||||
|
newReturnsError: tc.loaderNewReturnsError,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_, err := makeAndLoadKustTargetWithLoaderOverride(t, th.GetFSys(), "/should-fail", ldrWrapper).AccumulateTarget()
|
||||||
|
require.Error(t, err)
|
||||||
|
errString := err.Error()
|
||||||
|
assert.Contains(t, errString, "accumulating resources from 'resources.yaml'")
|
||||||
|
assert.Contains(t, errString, "MalformedYAMLError: yaml: line 3: mapping values are not allowed in this context")
|
||||||
|
if tc.shouldShowLoadError {
|
||||||
|
assert.Regexp(t, `hit \w+ timeout running '`, errString)
|
||||||
|
} else {
|
||||||
|
assert.NotRegexp(t, `hit \w+ timeout running '`, errString)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// loaderNewReturnsError duplicates baseLoader's behavior except
|
||||||
|
// that New() returns the specified error.
|
||||||
|
type loaderNewThrowsError struct {
|
||||||
|
baseLoader ifc.Loader
|
||||||
|
newReturnsError error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderNewThrowsError) Repo() string {
|
||||||
|
return l.baseLoader.Repo()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderNewThrowsError) Root() string {
|
||||||
|
return l.baseLoader.Root()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderNewThrowsError) New(_ string) (ifc.Loader, error) {
|
||||||
|
return nil, l.newReturnsError
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderNewThrowsError) Load(location string) ([]byte, error) {
|
||||||
|
return l.baseLoader.Load(location) //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderNewThrowsError) Cleanup() error {
|
||||||
|
return l.baseLoader.Cleanup() //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestErrorMessageForMalformedYAMLAndInvalidBase(t *testing.T) {
|
||||||
|
// These testcases verify behavior for the scenario described in
|
||||||
|
// https://github.com/kubernetes-sigs/kustomize/issues/5692 .
|
||||||
|
|
||||||
|
// Use a test server to fake the remote file response
|
||||||
|
handler := http.NewServeMux()
|
||||||
|
handler.HandleFunc("/", func(out http.ResponseWriter, req *http.Request) {
|
||||||
|
// Per issue #5692, the server should return a 200 status code with a response body that fails to parse as YAML
|
||||||
|
out.WriteHeader(http.StatusOK)
|
||||||
|
_, _ = out.Write([]byte(`<!DOCTYPE html>
|
||||||
|
<html class="html-devise-layout ui-light-gray" lang="en">
|
||||||
|
<head prefix="og: http://ogp.me/ns#">`))
|
||||||
|
})
|
||||||
|
svr := httptest.NewServer(handler)
|
||||||
|
defer svr.Close()
|
||||||
|
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteF("/should-fail/kustomization.yml", "resources:\n- "+svr.URL)
|
||||||
|
th.WriteF("/should-fail/remote-repo/kustomization.yml", "this: is not a kustomization file!")
|
||||||
|
|
||||||
|
ldrWrapper := func(baseLoader ifc.Loader) ifc.Loader {
|
||||||
|
return &loaderWithRenamedRoots{
|
||||||
|
baseLoader: baseLoader,
|
||||||
|
fakeRootMap: map[string]string{
|
||||||
|
// Use the "remote-repo" subdir instead of the remote git repo
|
||||||
|
svr.URL: "remote-repo",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := makeAndLoadKustTargetWithLoaderOverride(t, th.GetFSys(), "/should-fail", ldrWrapper).AccumulateTarget()
|
||||||
|
require.Error(t, err)
|
||||||
|
errString := err.Error()
|
||||||
|
assert.Contains(t, errString, "accumulating resources from '"+svr.URL+"'")
|
||||||
|
assert.Contains(t, errString, "MalformedYAMLError: yaml: line 3: mapping values are not allowed in this context")
|
||||||
|
assert.Contains(t, errString, `invalid Kustomization: json: unknown field "this"`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// loaderWithRenamedRoots is a loader that can map New() roots to some other name
|
||||||
|
type loaderWithRenamedRoots struct {
|
||||||
|
baseLoader ifc.Loader
|
||||||
|
fakeRootMap map[string]string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderWithRenamedRoots) Repo() string {
|
||||||
|
return l.baseLoader.Repo()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderWithRenamedRoots) Root() string {
|
||||||
|
return l.baseLoader.Root()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderWithRenamedRoots) New(newRoot string) (ifc.Loader, error) {
|
||||||
|
if otherRoot, ok := l.fakeRootMap[newRoot]; ok {
|
||||||
|
return l.baseLoader.New(otherRoot) //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|
||||||
|
return l.baseLoader.New(newRoot) //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderWithRenamedRoots) Load(path string) ([]byte, error) {
|
||||||
|
return l.baseLoader.Load(path) //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l loaderWithRenamedRoots) Cleanup() error {
|
||||||
|
return l.baseLoader.Cleanup() //nolint:wrapcheck // baseLoader's error is sufficient
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package target_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
fLdr "sigs.k8s.io/kustomize/api/internal/loader"
|
fLdr "sigs.k8s.io/kustomize/api/internal/loader"
|
||||||
pLdr "sigs.k8s.io/kustomize/api/internal/plugins/loader"
|
pLdr "sigs.k8s.io/kustomize/api/internal/plugins/loader"
|
||||||
"sigs.k8s.io/kustomize/api/internal/target"
|
"sigs.k8s.io/kustomize/api/internal/target"
|
||||||
@@ -21,11 +22,7 @@ func makeAndLoadKustTarget(
|
|||||||
fSys filesys.FileSystem,
|
fSys filesys.FileSystem,
|
||||||
root string) *target.KustTarget {
|
root string) *target.KustTarget {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
kt := makeKustTargetWithRf(t, fSys, root, provider.NewDefaultDepProvider())
|
return makeAndLoadKustTargetWithLoaderOverride(t, fSys, root, nil)
|
||||||
if err := kt.Load(); err != nil {
|
|
||||||
t.Fatalf("Unexpected load error %v", err)
|
|
||||||
}
|
|
||||||
return kt
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeKustTargetWithRf(
|
func makeKustTargetWithRf(
|
||||||
@@ -34,10 +31,37 @@ func makeKustTargetWithRf(
|
|||||||
root string,
|
root string,
|
||||||
pvd *provider.DepProvider) *target.KustTarget {
|
pvd *provider.DepProvider) *target.KustTarget {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
ldr, err := fLdr.NewLoader(fLdr.RestrictionRootOnly, root, fSys)
|
return makeKustTargetWithRfAndLoaderOverride(t, fSys, root, pvd, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeAndLoadKustTargetWithLoaderOverride(
|
||||||
|
t *testing.T,
|
||||||
|
fSys filesys.FileSystem,
|
||||||
|
root string,
|
||||||
|
ldrWrapperFn func(ifc.Loader) ifc.Loader) *target.KustTarget {
|
||||||
|
t.Helper()
|
||||||
|
kt := makeKustTargetWithRfAndLoaderOverride(t, fSys, root, provider.NewDefaultDepProvider(), ldrWrapperFn)
|
||||||
|
if err := kt.Load(); err != nil {
|
||||||
|
t.Fatalf("Unexpected load error %v", err)
|
||||||
|
}
|
||||||
|
return kt
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeKustTargetWithRfAndLoaderOverride(
|
||||||
|
t *testing.T,
|
||||||
|
fSys filesys.FileSystem,
|
||||||
|
root string,
|
||||||
|
pvd *provider.DepProvider,
|
||||||
|
ldrWrapperFn func(ifc.Loader) ifc.Loader) *target.KustTarget {
|
||||||
|
t.Helper()
|
||||||
|
baseLoader, err := fLdr.NewLoader(fLdr.RestrictionRootOnly, root, fSys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
ldr := baseLoader
|
||||||
|
if ldrWrapperFn != nil {
|
||||||
|
ldr = ldrWrapperFn(baseLoader)
|
||||||
|
}
|
||||||
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
rf := resmap.NewFactory(pvd.GetResourceFactory())
|
||||||
pc := types.DisabledPluginConfig()
|
pc := types.DisabledPluginConfig()
|
||||||
return target.NewKustTarget(
|
return target.NewKustTarget(
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ type errTimeOut struct {
|
|||||||
cmd string
|
cmd string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewErrTimeOut(d time.Duration, c string) errTimeOut {
|
func NewErrTimeOut(d time.Duration, c string) *errTimeOut {
|
||||||
return errTimeOut{duration: d, cmd: c}
|
return &errTimeOut{duration: d, cmd: c}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e errTimeOut) Error() string {
|
func (e *errTimeOut) Error() string {
|
||||||
return fmt.Sprintf("hit %s timeout running '%s'", e.duration, e.cmd)
|
return fmt.Sprintf("hit %s timeout running '%s'", e.duration, e.cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ package krusty_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httptest"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -29,6 +31,20 @@ spec:
|
|||||||
- port: 7002
|
- port: 7002
|
||||||
`
|
`
|
||||||
|
|
||||||
|
const invalidResource = `apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: kapacitor
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: tick-kapacitor
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/name: tick-kapacitor
|
||||||
|
- name: http
|
||||||
|
port: 9092
|
||||||
|
protocol: TCP
|
||||||
|
type: ClusterIP`
|
||||||
|
|
||||||
func TestTargetMustHaveKustomizationFile(t *testing.T) {
|
func TestTargetMustHaveKustomizationFile(t *testing.T) {
|
||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
th.WriteF("service.yaml", `
|
th.WriteF("service.yaml", `
|
||||||
@@ -169,10 +185,15 @@ spec:
|
|||||||
|
|
||||||
func TestAccumulateResourcesErrors(t *testing.T) {
|
func TestAccumulateResourcesErrors(t *testing.T) {
|
||||||
type testcase struct {
|
type testcase struct {
|
||||||
name string
|
name string
|
||||||
resource string
|
resource string
|
||||||
isAbsolute bool
|
// resourceFunc generates a resource string using the URL to the local
|
||||||
files map[string]string
|
// test server (optional).
|
||||||
|
resourceFunc func(string) string
|
||||||
|
// resourceServerSetup configures the local test server (optional).
|
||||||
|
resourceServerSetup func(*http.ServeMux)
|
||||||
|
isAbsolute bool
|
||||||
|
files map[string]string
|
||||||
// errFile, errDir are regex for the expected error message output
|
// errFile, errDir are regex for the expected error message output
|
||||||
// when kustomize tries to accumulate resource as file and dir,
|
// when kustomize tries to accumulate resource as file and dir,
|
||||||
// respectively. The test substitutes occurrences of "%s" in the
|
// respectively. The test substitutes occurrences of "%s" in the
|
||||||
@@ -221,9 +242,14 @@ resources:
|
|||||||
for _, test := range []testcase{
|
for _, test := range []testcase{
|
||||||
{
|
{
|
||||||
name: "remote file not considered repo",
|
name: "remote file not considered repo",
|
||||||
// The example.com second-level domain is reserved and
|
resourceFunc: func(url string) string {
|
||||||
// safe to access, see RFC 2606.
|
return fmt.Sprintf("%s/segments-too-few-to-be-repo", url)
|
||||||
resource: "https://example.com/segments-too-few-to-be-repo",
|
},
|
||||||
|
resourceServerSetup: func(server *http.ServeMux) {
|
||||||
|
server.HandleFunc("/", func(out http.ResponseWriter, req *http.Request) {
|
||||||
|
out.WriteHeader(http.StatusNotFound)
|
||||||
|
})
|
||||||
|
},
|
||||||
// It's acceptable for the error output of a remote file-like
|
// It's acceptable for the error output of a remote file-like
|
||||||
// resource to not indicate the resource's status as a
|
// resource to not indicate the resource's status as a
|
||||||
// local directory. Though it is possible for a remote file-like
|
// local directory. Though it is possible for a remote file-like
|
||||||
@@ -231,8 +257,15 @@ resources:
|
|||||||
errFile: `HTTP Error: status code 404 \(Not Found\)\z`,
|
errFile: `HTTP Error: status code 404 \(Not Found\)\z`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "remote file qualifies as repo",
|
name: "remote file qualifies as repo",
|
||||||
resource: "https://example.com/long/enough/to/have/org/and/repo",
|
resourceFunc: func(url string) string {
|
||||||
|
return fmt.Sprintf("%s/long/enough/to/have/org/and/repo", url)
|
||||||
|
},
|
||||||
|
resourceServerSetup: func(server *http.ServeMux) {
|
||||||
|
server.HandleFunc("/", func(out http.ResponseWriter, req *http.Request) {
|
||||||
|
out.WriteHeader(http.StatusInternalServerError)
|
||||||
|
})
|
||||||
|
},
|
||||||
// TODO(4788): This error message is technically wrong. Just
|
// TODO(4788): This error message is technically wrong. Just
|
||||||
// because we fail to GET a resource does not mean the resource is
|
// because we fail to GET a resource does not mean the resource is
|
||||||
// not a remote file. We should return the GET status code as well.
|
// not a remote file. We should return the GET status code as well.
|
||||||
@@ -283,8 +316,29 @@ resources:
|
|||||||
// know resource is file.
|
// know resource is file.
|
||||||
errDir: `new root '%s' cannot be absolute`,
|
errDir: `new root '%s' cannot be absolute`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "malformed yaml yields an error",
|
||||||
|
resource: "service.yaml",
|
||||||
|
files: map[string]string{
|
||||||
|
"service.yaml": invalidResource,
|
||||||
|
},
|
||||||
|
errFile: "MalformedYAMLError",
|
||||||
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
if test.resourceFunc != nil {
|
||||||
|
// Configure test server handler
|
||||||
|
handler := http.NewServeMux()
|
||||||
|
if test.resourceServerSetup != nil {
|
||||||
|
test.resourceServerSetup(handler)
|
||||||
|
}
|
||||||
|
// Start test server
|
||||||
|
svr := httptest.NewServer(handler)
|
||||||
|
defer svr.Close()
|
||||||
|
// Generate resource with test server address
|
||||||
|
test.resource = test.resourceFunc(svr.URL)
|
||||||
|
}
|
||||||
|
|
||||||
// Should use real file system to indicate that we are creating
|
// Should use real file system to indicate that we are creating
|
||||||
// new temporary directories on disk when we attempt to fetch repos.
|
// new temporary directories on disk when we attempt to fetch repos.
|
||||||
fs, tmpDir := kusttest_test.Setup(t)
|
fs, tmpDir := kusttest_test.Setup(t)
|
||||||
@@ -306,5 +360,4 @@ resources:
|
|||||||
// TODO(annasong): add tests that check accumulateResources errors for
|
// TODO(annasong): add tests that check accumulateResources errors for
|
||||||
// - repos
|
// - repos
|
||||||
// - local directories
|
// - local directories
|
||||||
// - files that yield malformed yaml errors
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -591,3 +591,184 @@ metadata:
|
|||||||
name: test-m8t7bmb6g2
|
name: test-m8t7bmb6g2
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Regression test for https://github.com/kubernetes-sigs/kustomize/issues/5047
|
||||||
|
func TestPrefixSuffix(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteF("kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("a/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- ../common
|
||||||
|
|
||||||
|
namePrefix: a
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("b/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- ../common
|
||||||
|
|
||||||
|
namePrefix: b
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("common/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- service
|
||||||
|
|
||||||
|
configMapGenerator:
|
||||||
|
- name: "-example-configmap"
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("common/service/deployment.yaml", `
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
|
||||||
|
metadata:
|
||||||
|
name: "-"
|
||||||
|
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: app
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: "-example-configmap"
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("common/service/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
|
||||||
|
nameSuffix: api
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: a-api
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: a-example-configmap-6ct58987ht
|
||||||
|
name: app
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: a-example-configmap-6ct58987ht
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: b-api
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: b-example-configmap-6ct58987ht
|
||||||
|
name: app
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: b-example-configmap-6ct58987ht
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Regression test for https://github.com/kubernetes-sigs/kustomize/issues/5047
|
||||||
|
func TestPrefixSuffix2(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteF("kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("a/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- ../common
|
||||||
|
|
||||||
|
namePrefix: a
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("b/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- ../common
|
||||||
|
|
||||||
|
namePrefix: b
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("common/deployment.yaml", `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: "-example"
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: app
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: "-example-configmap"
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("common/kustomization.yaml", `
|
||||||
|
resources:
|
||||||
|
- deployment.yaml
|
||||||
|
|
||||||
|
configMapGenerator:
|
||||||
|
- name: "-example-configmap"
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: a-example
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: a-example-configmap-6ct58987ht
|
||||||
|
name: app
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: a-example-configmap-6ct58987ht
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: b-example
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: b-example-configmap-6ct58987ht
|
||||||
|
name: app
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: b-example-configmap-6ct58987ht
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,12 +17,16 @@ commonLabels:
|
|||||||
vars:
|
vars:
|
||||||
- name: APRIL_DIET
|
- name: APRIL_DIET
|
||||||
objref:
|
objref:
|
||||||
|
group: foo
|
||||||
|
version: v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
name: april
|
name: april
|
||||||
fieldref:
|
fieldref:
|
||||||
fieldpath: spec.diet
|
fieldpath: spec.diet
|
||||||
- name: KOKO_DIET
|
- name: KOKO_DIET
|
||||||
objref:
|
objref:
|
||||||
|
group: foo
|
||||||
|
version: v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
name: koko
|
name: koko
|
||||||
fieldref:
|
fieldref:
|
||||||
@@ -36,6 +40,7 @@ configurations:
|
|||||||
- config/custom.yaml
|
- config/custom.yaml
|
||||||
`)
|
`)
|
||||||
th.WriteF("base/giraffes.yaml", `
|
th.WriteF("base/giraffes.yaml", `
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
name: april
|
name: april
|
||||||
@@ -43,6 +48,7 @@ spec:
|
|||||||
diet: mimosa
|
diet: mimosa
|
||||||
location: NE
|
location: NE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
name: may
|
name: may
|
||||||
@@ -51,6 +57,7 @@ spec:
|
|||||||
location: SE
|
location: SE
|
||||||
`)
|
`)
|
||||||
th.WriteF("base/gorilla.yaml", `
|
th.WriteF("base/gorilla.yaml", `
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
name: koko
|
name: koko
|
||||||
@@ -59,7 +66,7 @@ spec:
|
|||||||
location: SW
|
location: SW
|
||||||
`)
|
`)
|
||||||
th.WriteF("base/animalPark.yaml", `
|
th.WriteF("base/animalPark.yaml", `
|
||||||
apiVersion: foo
|
apiVersion: foo/v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
name: sandiego
|
name: sandiego
|
||||||
@@ -94,7 +101,7 @@ varReference:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("base", th.MakeDefaultOptions())
|
m := th.Run("base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: foo
|
apiVersion: foo/v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -109,6 +116,7 @@ spec:
|
|||||||
gorillaRef:
|
gorillaRef:
|
||||||
name: x-koko
|
name: x-koko
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -118,6 +126,7 @@ spec:
|
|||||||
diet: mimosa
|
diet: mimosa
|
||||||
location: NE
|
location: NE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -127,6 +136,7 @@ spec:
|
|||||||
diet: acacia
|
diet: acacia
|
||||||
location: SE
|
location: SE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -163,7 +173,7 @@ varReference:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("base", th.MakeDefaultOptions())
|
m := th.Run("base", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: foo
|
apiVersion: foo/v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -178,6 +188,7 @@ spec:
|
|||||||
gorillaRef:
|
gorillaRef:
|
||||||
name: x-koko
|
name: x-koko
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -187,6 +198,7 @@ spec:
|
|||||||
diet: mimosa
|
diet: mimosa
|
||||||
location: NE
|
location: NE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -196,6 +208,7 @@ spec:
|
|||||||
diet: acacia
|
diet: acacia
|
||||||
location: SE
|
location: SE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -215,17 +228,20 @@ func TestFixedBug605_BaseCustomizationAvailableInOverlay(t *testing.T) {
|
|||||||
nameReference:
|
nameReference:
|
||||||
- kind: Gorilla
|
- kind: Gorilla
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- apiVersion: foo
|
- group: foo
|
||||||
|
version: v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
path: spec/gorillaRef/name
|
path: spec/gorillaRef/name
|
||||||
- kind: Giraffe
|
- kind: Giraffe
|
||||||
fieldSpecs:
|
fieldSpecs:
|
||||||
- apiVersion: foo
|
- group: foo
|
||||||
|
version: v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
path: spec/giraffeRef/name
|
path: spec/giraffeRef/name
|
||||||
varReference:
|
varReference:
|
||||||
- path: spec/food
|
- path: spec/food
|
||||||
apiVersion: foo
|
group: foo
|
||||||
|
version: v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
`)
|
`)
|
||||||
th.WriteK("overlay", `
|
th.WriteK("overlay", `
|
||||||
@@ -239,6 +255,7 @@ resources:
|
|||||||
- ursus.yaml
|
- ursus.yaml
|
||||||
`)
|
`)
|
||||||
th.WriteF("overlay/ursus.yaml", `
|
th.WriteF("overlay/ursus.yaml", `
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
name: ursus
|
name: ursus
|
||||||
@@ -248,7 +265,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
// The following replaces the gorillaRef in the AnimalPark.
|
// The following replaces the gorillaRef in the AnimalPark.
|
||||||
th.WriteF("overlay/animalPark.yaml", `
|
th.WriteF("overlay/animalPark.yaml", `
|
||||||
apiVersion: foo
|
apiVersion: foo/v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
name: sandiego
|
name: sandiego
|
||||||
@@ -258,7 +275,7 @@ spec:
|
|||||||
`)
|
`)
|
||||||
m := th.Run("overlay", th.MakeDefaultOptions())
|
m := th.Run("overlay", th.MakeDefaultOptions())
|
||||||
th.AssertActualEqualsExpected(m, `
|
th.AssertActualEqualsExpected(m, `
|
||||||
apiVersion: foo
|
apiVersion: foo/v1
|
||||||
kind: AnimalPark
|
kind: AnimalPark
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -274,6 +291,7 @@ spec:
|
|||||||
gorillaRef:
|
gorillaRef:
|
||||||
name: o-ursus
|
name: o-ursus
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -284,6 +302,7 @@ spec:
|
|||||||
diet: mimosa
|
diet: mimosa
|
||||||
location: NE
|
location: NE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Giraffe
|
kind: Giraffe
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -294,6 +313,7 @@ spec:
|
|||||||
diet: acacia
|
diet: acacia
|
||||||
location: SE
|
location: SE
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -304,6 +324,7 @@ spec:
|
|||||||
diet: bambooshoots
|
diet: bambooshoots
|
||||||
location: SW
|
location: SW
|
||||||
---
|
---
|
||||||
|
apiVersion: foo/v1
|
||||||
kind: Gorilla
|
kind: Gorilla
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
@@ -314,3 +335,400 @@ spec:
|
|||||||
location: Arizona
|
location: Arizona
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestLabelTransformerConfig(t *testing.T) {
|
||||||
|
testCases := []struct {
|
||||||
|
name string
|
||||||
|
kustomization string
|
||||||
|
transformerConfig string
|
||||||
|
expectedResult string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "includeSelectors=false, includeTemplates=false, include template via transformerConfig",
|
||||||
|
kustomization: `configurations:
|
||||||
|
- config/configurations.yaml
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/deployment.yaml
|
||||||
|
`,
|
||||||
|
transformerConfig: `labels:
|
||||||
|
- path: spec/template/metadata/labels
|
||||||
|
create: true
|
||||||
|
kind: Deployment
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-deploy
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sample-deploy
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: hello-world:latest
|
||||||
|
name: hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "includeSelectors=true, includeTemplates=false, include template via transformerConfig",
|
||||||
|
kustomization: `configurations:
|
||||||
|
- config/configurations.yaml
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- includeSelectors: true
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/deployment.yaml
|
||||||
|
`,
|
||||||
|
transformerConfig: `labels:
|
||||||
|
- path: spec/template/metadata/labels
|
||||||
|
create: true
|
||||||
|
kind: Deployment
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-deploy
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: hello-world:latest
|
||||||
|
name: hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "includeSelectors=false, includeTemplates=true, no transformerConfig",
|
||||||
|
kustomization: `labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: true
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/deployment.yaml
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-deploy
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sample-deploy
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: hello-world:latest
|
||||||
|
name: hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "includeSelectors=false, includeTemplates=false, no transformerConfig",
|
||||||
|
kustomization: `labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/deployment.yaml
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-deploy
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sample-deploy
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: hello-world:latest
|
||||||
|
name: hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", tc.kustomization)
|
||||||
|
th.WriteF("resources/deployment.yaml",
|
||||||
|
`apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
name: sample-deploy
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: sample-deploy
|
||||||
|
|
||||||
|
strategy: {}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels:
|
||||||
|
app: sample-deploy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: hello-world:latest
|
||||||
|
name: hello-world
|
||||||
|
`)
|
||||||
|
if tc.transformerConfig != "" {
|
||||||
|
th.WriteF("config/configurations.yaml", tc.transformerConfig)
|
||||||
|
}
|
||||||
|
|
||||||
|
output := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(output, tc.expectedResult)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestLabelTransformerConfigWithCustomResources(t *testing.T) {
|
||||||
|
testCases := []struct {
|
||||||
|
name string
|
||||||
|
kustomization string
|
||||||
|
transformerConfig string
|
||||||
|
expectedResult string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "include template via transformerConfig",
|
||||||
|
kustomization: `configurations:
|
||||||
|
- config/configurations.yaml
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/custom-resource.yaml
|
||||||
|
`,
|
||||||
|
transformerConfig: `labels:
|
||||||
|
- path: spec/template/metadata/labels
|
||||||
|
create: true
|
||||||
|
kind: SampleResource
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: custom.example.org/v1
|
||||||
|
kind: SampleResource
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-resource
|
||||||
|
namespace: sample-namespace
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: VARIABLE
|
||||||
|
value: value
|
||||||
|
image: index.docker.io/library/hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "include selector via transformerConfig",
|
||||||
|
kustomization: `configurations:
|
||||||
|
- config/configurations.yaml
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/custom-resource.yaml
|
||||||
|
`,
|
||||||
|
transformerConfig: `labels:
|
||||||
|
- path: spec/selectors/labels
|
||||||
|
create: true
|
||||||
|
kind: SampleResource
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: custom.example.org/v1
|
||||||
|
kind: SampleResource
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-resource
|
||||||
|
namespace: sample-namespace
|
||||||
|
spec:
|
||||||
|
selectors:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: VARIABLE
|
||||||
|
value: value
|
||||||
|
image: index.docker.io/library/hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "include selectors and labels via transformerConfig",
|
||||||
|
kustomization: `configurations:
|
||||||
|
- config/configurations.yaml
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- includeSelectors: false
|
||||||
|
includeTemplates: false
|
||||||
|
pairs:
|
||||||
|
location: planet-earth
|
||||||
|
environment: dev
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- resources/custom-resource.yaml
|
||||||
|
`,
|
||||||
|
transformerConfig: `
|
||||||
|
labels:
|
||||||
|
- path: spec/selectors/labels
|
||||||
|
create: true
|
||||||
|
kind: SampleResource
|
||||||
|
- path: spec/template/metadata/labels
|
||||||
|
create: true
|
||||||
|
kind: SampleResource
|
||||||
|
`,
|
||||||
|
expectedResult: `apiVersion: custom.example.org/v1
|
||||||
|
kind: SampleResource
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
name: sample-resource
|
||||||
|
namespace: sample-namespace
|
||||||
|
spec:
|
||||||
|
selectors:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
environment: dev
|
||||||
|
location: planet-earth
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- env:
|
||||||
|
- name: VARIABLE
|
||||||
|
value: value
|
||||||
|
image: index.docker.io/library/hello-world
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tc := range testCases {
|
||||||
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", tc.kustomization)
|
||||||
|
th.WriteF("resources/custom-resource.yaml",
|
||||||
|
`apiVersion: custom.example.org/v1
|
||||||
|
kind: SampleResource
|
||||||
|
metadata:
|
||||||
|
name: sample-resource
|
||||||
|
namespace: sample-namespace
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: index.docker.io/library/hello-world
|
||||||
|
env:
|
||||||
|
- name: VARIABLE
|
||||||
|
value: value
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("config/configurations.yaml", tc.transformerConfig)
|
||||||
|
|
||||||
|
output := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(output, tc.expectedResult)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -41,6 +42,6 @@ spec:
|
|||||||
`)
|
`)
|
||||||
m := th.Run(".", th.MakeDefaultOptions())
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
_, err := m.AsYaml()
|
_, err := m.AsYaml()
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "mapping key \"env\" already defined")
|
assert.Contains(t, err.Error(), "mapping key \"env\" already defined")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
package krusty_test
|
package krusty_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
. "sigs.k8s.io/kustomize/api/krusty"
|
. "sigs.k8s.io/kustomize/api/krusty"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||||
@@ -65,7 +67,7 @@ func TestFnExecGeneratorInBase(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -90,7 +92,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -104,7 +106,7 @@ spec:
|
|||||||
|
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -138,7 +140,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFnExecGeneratorInBaseWithOverlay(t *testing.T) {
|
func TestFnExecGeneratorInBaseWithOverlay(t *testing.T) {
|
||||||
@@ -149,11 +151,11 @@ func TestFnExecGeneratorInBaseWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -180,7 +182,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -193,9 +195,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -229,7 +231,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFnExecGeneratorInOverlay(t *testing.T) {
|
func TestFnExecGeneratorInOverlay(t *testing.T) {
|
||||||
@@ -240,11 +242,11 @@ func TestFnExecGeneratorInOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -271,7 +273,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(prod, "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(prod, "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(prod, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(prod, "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(prod, "gener.yaml"), `
|
th.WriteF(filepath.Join(prod, "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -284,9 +286,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -320,7 +322,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFnExecTransformerInBase(t *testing.T) {
|
func TestFnExecTransformerInBase(t *testing.T) {
|
||||||
@@ -331,9 +333,9 @@ func TestFnExecTransformerInBase(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- secret.yaml
|
- secret.yaml
|
||||||
@@ -352,7 +354,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(base, "krmTransformer.sh"), krmTransformerDotSh)
|
th.WriteF(filepath.Join(base, "krmTransformer.sh"), krmTransformerDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "krmTransformer.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "krmTransformer.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(base, "krm-transformer.yaml"), `
|
th.WriteF(filepath.Join(base, "krm-transformer.yaml"), `
|
||||||
apiVersion: examples.config.kubernetes.io/v1beta1
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
kind: MyPlugin
|
kind: MyPlugin
|
||||||
@@ -366,7 +368,7 @@ metadata:
|
|||||||
|
|
||||||
m := th.Run(base, o)
|
m := th.Run(base, o)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -375,7 +377,7 @@ stringData:
|
|||||||
foo: bar
|
foo: bar
|
||||||
type: Opaque
|
type: Opaque
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFnExecTransformerInBaseWithOverlay(t *testing.T) {
|
func TestFnExecTransformerInBaseWithOverlay(t *testing.T) {
|
||||||
@@ -386,11 +388,11 @@ func TestFnExecTransformerInBaseWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- secret.yaml
|
- secret.yaml
|
||||||
@@ -413,7 +415,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(base, "krmTransformer.sh"), krmTransformerDotSh)
|
th.WriteF(filepath.Join(base, "krmTransformer.sh"), krmTransformerDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "krmTransformer.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "krmTransformer.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(base, "krm-transformer.yaml"), `
|
th.WriteF(filepath.Join(base, "krm-transformer.yaml"), `
|
||||||
apiVersion: examples.config.kubernetes.io/v1beta1
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
kind: MyPlugin
|
kind: MyPlugin
|
||||||
@@ -427,7 +429,7 @@ metadata:
|
|||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -436,7 +438,7 @@ stringData:
|
|||||||
foo: bar
|
foo: bar
|
||||||
type: Opaque
|
type: Opaque
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFnExecTransformerInOverlay(t *testing.T) {
|
func TestFnExecTransformerInOverlay(t *testing.T) {
|
||||||
@@ -447,11 +449,11 @@ func TestFnExecTransformerInOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- secret.yaml
|
- secret.yaml
|
||||||
@@ -474,7 +476,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(prod, "krmTransformer.sh"), krmTransformerDotSh)
|
th.WriteF(filepath.Join(prod, "krmTransformer.sh"), krmTransformerDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(prod, "krmTransformer.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(prod, "krmTransformer.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(prod, "krm-transformer.yaml"), `
|
th.WriteF(filepath.Join(prod, "krm-transformer.yaml"), `
|
||||||
apiVersion: examples.config.kubernetes.io/v1beta1
|
apiVersion: examples.config.kubernetes.io/v1beta1
|
||||||
kind: MyPlugin
|
kind: MyPlugin
|
||||||
@@ -488,7 +490,7 @@ metadata:
|
|||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -497,7 +499,7 @@ stringData:
|
|||||||
foo: bar
|
foo: bar
|
||||||
type: Opaque
|
type: Opaque
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func skipIfNoDocker(t *testing.T) {
|
func skipIfNoDocker(t *testing.T) {
|
||||||
@@ -512,7 +514,7 @@ func TestFnContainerGenerator(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
o := th.MakeOptionsPluginsEnabled()
|
o := th.MakeOptionsPluginsEnabled()
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
@@ -545,12 +547,12 @@ metadata:
|
|||||||
"-t", "gcr.io/kustomize-functions/e2econtainersimplegenerator",
|
"-t", "gcr.io/kustomize-functions/e2econtainersimplegenerator",
|
||||||
)
|
)
|
||||||
build.Dir = repoRootDir
|
build.Dir = repoRootDir
|
||||||
assert.NoError(t, build.Run())
|
require.NoError(t, run(build))
|
||||||
|
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
actual, err := m.AsYaml()
|
actual, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
require.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: simplegenerator
|
name: simplegenerator
|
||||||
@@ -577,7 +579,7 @@ func TestFnContainerTransformer(t *testing.T) {
|
|||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
o := th.MakeOptionsPluginsEnabled()
|
o := th.MakeOptionsPluginsEnabled()
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
@@ -605,10 +607,10 @@ metadata:
|
|||||||
"-t", "gcr.io/kustomize-functions/e2econtainerconfig",
|
"-t", "gcr.io/kustomize-functions/e2econtainerconfig",
|
||||||
)
|
)
|
||||||
build.Dir = repoRootDir
|
build.Dir = repoRootDir
|
||||||
assert.NoError(t, build.Run())
|
require.NoError(t, run(build))
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
actual, err := m.AsYaml()
|
actual, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -627,33 +629,33 @@ func TestFnContainerTransformerWithConfig(t *testing.T) {
|
|||||||
"-f", "build/label_namespace.Dockerfile",
|
"-f", "build/label_namespace.Dockerfile",
|
||||||
"-t", "gcr.io/kpt-functions/label-namespace:go-sdk-v0.0.1",
|
"-t", "gcr.io/kpt-functions/label-namespace:go-sdk-v0.0.1",
|
||||||
)
|
)
|
||||||
assert.NoError(t, build.Run())
|
require.NoError(t, run(build))
|
||||||
th := kusttest_test.MakeHarness(t)
|
th := kusttest_test.MakeHarness(t)
|
||||||
o := th.MakeOptionsPluginsEnabled()
|
o := th.MakeOptionsPluginsEnabled()
|
||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := MakeKustomizer(&o)
|
b := MakeKustomizer(&o)
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
resources:
|
resources:
|
||||||
- data1.yaml
|
- data1.yaml
|
||||||
- data2.yaml
|
- data2.yaml
|
||||||
transformers:
|
transformers:
|
||||||
- label_namespace.yaml
|
- label_namespace.yaml
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "data1.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "data1.yaml"), []byte(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: my-namespace
|
name: my-namespace
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "data2.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "data2.yaml"), []byte(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
name: another-namespace
|
name: another-namespace
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "label_namespace.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "label_namespace.yaml"), []byte(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
@@ -669,9 +671,9 @@ data:
|
|||||||
m, err := b.Run(
|
m, err := b.Run(
|
||||||
fSys,
|
fSys,
|
||||||
tmpDir.String())
|
tmpDir.String())
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
actual, err := m.AsYaml()
|
actual, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Namespace
|
kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
@@ -695,12 +697,12 @@ func TestFnContainerEnvVars(t *testing.T) {
|
|||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := MakeKustomizer(&o)
|
b := MakeKustomizer(&o)
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
generators:
|
generators:
|
||||||
- gener.yaml
|
- gener.yaml
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "gener.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "gener.yaml"), []byte(`
|
||||||
apiVersion: kustomize.sigs.k8s.io/v1alpha1
|
apiVersion: kustomize.sigs.k8s.io/v1alpha1
|
||||||
kind: EnvTemplateGenerator
|
kind: EnvTemplateGenerator
|
||||||
metadata:
|
metadata:
|
||||||
@@ -724,14 +726,14 @@ template: |
|
|||||||
"-t", "gcr.io/kustomize-functions/e2econtainerenvgenerator",
|
"-t", "gcr.io/kustomize-functions/e2econtainerenvgenerator",
|
||||||
)
|
)
|
||||||
build.Dir = repoRootDir
|
build.Dir = repoRootDir
|
||||||
assert.NoError(t, build.Run())
|
require.NoError(t, run(build))
|
||||||
|
|
||||||
m, err := b.Run(
|
m, err := b.Run(
|
||||||
fSys,
|
fSys,
|
||||||
tmpDir.String())
|
tmpDir.String())
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
actual, err := m.AsYaml()
|
actual, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
data:
|
data:
|
||||||
value: value
|
value: value
|
||||||
@@ -748,12 +750,12 @@ func TestFnContainerFnMounts(t *testing.T) {
|
|||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := MakeKustomizer(&o)
|
b := MakeKustomizer(&o)
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
generators:
|
generators:
|
||||||
- gener.yaml
|
- gener.yaml
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "gener.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "gener.yaml"), []byte(`
|
||||||
apiVersion: kustomize.sigs.k8s.io/v1alpha1
|
apiVersion: kustomize.sigs.k8s.io/v1alpha1
|
||||||
kind: RenderHelmChart
|
kind: RenderHelmChart
|
||||||
metadata:
|
metadata:
|
||||||
@@ -768,8 +770,8 @@ metadata:
|
|||||||
dst: "/tmp/yaml"
|
dst: "/tmp/yaml"
|
||||||
path: /tmp/yaml/resources.yaml
|
path: /tmp/yaml/resources.yaml
|
||||||
`)))
|
`)))
|
||||||
assert.NoError(t, fSys.MkdirAll(filepath.Join(tmpDir.String(), "yaml", "tmp")))
|
require.NoError(t, fSys.MkdirAll(filepath.Join(tmpDir.String(), "yaml", "tmp")))
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "yaml", "resources.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "yaml", "resources.yaml"), []byte(`
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -782,14 +784,14 @@ spec:
|
|||||||
"-t", "gcr.io/kustomize-functions/e2econtainermountbind",
|
"-t", "gcr.io/kustomize-functions/e2econtainermountbind",
|
||||||
)
|
)
|
||||||
build.Dir = repoRootDir
|
build.Dir = repoRootDir
|
||||||
assert.NoError(t, build.Run())
|
require.NoError(t, run(build))
|
||||||
|
|
||||||
m, err := b.Run(
|
m, err := b.Run(
|
||||||
fSys,
|
fSys,
|
||||||
tmpDir.String())
|
tmpDir.String())
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
actual, err := m.AsYaml()
|
actual, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -806,8 +808,8 @@ func TestFnContainerMountsLoadRestrictions_absolute(t *testing.T) {
|
|||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := MakeKustomizer(&o)
|
b := MakeKustomizer(&o)
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
generators:
|
generators:
|
||||||
- |-
|
- |-
|
||||||
apiVersion: v1alpha1
|
apiVersion: v1alpha1
|
||||||
@@ -826,7 +828,7 @@ generators:
|
|||||||
_, err = b.Run(
|
_, err = b.Run(
|
||||||
fSys,
|
fSys,
|
||||||
tmpDir.String())
|
tmpDir.String())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "loading generator plugins: failed to load generator: plugin RenderHelmChart."+
|
assert.Contains(t, err.Error(), "loading generator plugins: failed to load generator: plugin RenderHelmChart."+
|
||||||
"v1alpha1.[noGrp]/demo.[noNs] with mount path '/tmp/dir' is not permitted; mount paths must"+
|
"v1alpha1.[noGrp]/demo.[noNs] with mount path '/tmp/dir' is not permitted; mount paths must"+
|
||||||
" be relative to the current kustomization directory")
|
" be relative to the current kustomization directory")
|
||||||
@@ -839,8 +841,8 @@ func TestFnContainerMountsLoadRestrictions_outsideCurrentDir(t *testing.T) {
|
|||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := MakeKustomizer(&o)
|
b := MakeKustomizer(&o)
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
generators:
|
generators:
|
||||||
- |-
|
- |-
|
||||||
apiVersion: v1alpha1
|
apiVersion: v1alpha1
|
||||||
@@ -859,7 +861,7 @@ generators:
|
|||||||
_, err = b.Run(
|
_, err = b.Run(
|
||||||
fSys,
|
fSys,
|
||||||
tmpDir.String())
|
tmpDir.String())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "loading generator plugins: failed to load generator: plugin RenderHelmChart."+
|
assert.Contains(t, err.Error(), "loading generator plugins: failed to load generator: plugin RenderHelmChart."+
|
||||||
"v1alpha1.[noGrp]/demo.[noNs] with mount path './tmp/../../dir' is not permitted; mount paths must "+
|
"v1alpha1.[noGrp]/demo.[noNs] with mount path './tmp/../../dir' is not permitted; mount paths must "+
|
||||||
"be under the current kustomization directory")
|
"be under the current kustomization directory")
|
||||||
@@ -887,6 +889,15 @@ spec:
|
|||||||
replicas: 3
|
replicas: 3
|
||||||
`)
|
`)
|
||||||
err := th.RunWithErr(".", th.MakeOptionsPluginsEnabled())
|
err := th.RunWithErr(".", th.MakeOptionsPluginsEnabled())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.EqualError(t, err, "couldn't execute function: root working directory '/' not allowed")
|
assert.EqualError(t, err, "couldn't execute function: root working directory '/' not allowed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// run calls Cmd.Run and wraps the error to include the output to make debugging
|
||||||
|
// easier. Not safe for real code, but fine for tests.
|
||||||
|
func run(cmd *exec.Cmd) error {
|
||||||
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
|
return fmt.Errorf("%w\n--- COMMAND OUTPUT ---\n%s", err, string(out))
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package krusty_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/require"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ spec:
|
|||||||
options := th.MakeDefaultOptions()
|
options := th.MakeDefaultOptions()
|
||||||
// depPatch cannot find target with kind `Deployment` and name `new-name`
|
// depPatch cannot find target with kind `Deployment` and name `new-name`
|
||||||
// because the resource never had this GVKN
|
// because the resource never had this GVKN
|
||||||
assert.Error(t, th.RunWithErr("overlay", options))
|
require.Error(t, th.RunWithErr("overlay", options))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here is a structure of a kustomization of two components, component1
|
// Here is a structure of a kustomization of two components, component1
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ package krusty_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/require"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ spec:
|
|||||||
- image: whatever
|
- image: whatever
|
||||||
`)
|
`)
|
||||||
err := th.RunWithErr("gcp", th.MakeDefaultOptions())
|
err := th.RunWithErr("gcp", th.MakeDefaultOptions())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test for issue #3228
|
// Test for issue #3228
|
||||||
|
|||||||
@@ -786,3 +786,85 @@ spec:
|
|||||||
name: tester
|
name: tester
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBackReferenceAdmissionPolicy(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- admission.yaml
|
||||||
|
|
||||||
|
namePrefix: a-prefix-
|
||||||
|
`)
|
||||||
|
th.WriteF("admission.yaml", `---
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||||
|
kind: ValidatingAdmissionPolicy
|
||||||
|
metadata:
|
||||||
|
name: sample-policy
|
||||||
|
spec:
|
||||||
|
failurePolicy: Fail
|
||||||
|
paramKind:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
matchConstraints:
|
||||||
|
resourceRules:
|
||||||
|
- apiGroups:
|
||||||
|
- apps
|
||||||
|
apiVersions:
|
||||||
|
- v1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
validations:
|
||||||
|
- expression: "!object.metadata.name.startsWith('test-')"
|
||||||
|
message: prefix 'test-' is not allowed
|
||||||
|
reason: Invalid
|
||||||
|
---
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||||
|
kind: ValidatingAdmissionPolicyBinding
|
||||||
|
metadata:
|
||||||
|
name: sample-policy-binding
|
||||||
|
spec:
|
||||||
|
policyName: sample-policy
|
||||||
|
validationActions:
|
||||||
|
- Deny
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||||
|
kind: ValidatingAdmissionPolicy
|
||||||
|
metadata:
|
||||||
|
name: a-prefix-sample-policy
|
||||||
|
spec:
|
||||||
|
failurePolicy: Fail
|
||||||
|
matchConstraints:
|
||||||
|
resourceRules:
|
||||||
|
- apiGroups:
|
||||||
|
- apps
|
||||||
|
apiVersions:
|
||||||
|
- v1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- deployments
|
||||||
|
paramKind:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
validations:
|
||||||
|
- expression: '!object.metadata.name.startsWith(''test-'')'
|
||||||
|
message: prefix 'test-' is not allowed
|
||||||
|
reason: Invalid
|
||||||
|
---
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1beta1
|
||||||
|
kind: ValidatingAdmissionPolicyBinding
|
||||||
|
metadata:
|
||||||
|
name: a-prefix-sample-policy-binding
|
||||||
|
spec:
|
||||||
|
policyName: a-prefix-sample-policy
|
||||||
|
validationActions:
|
||||||
|
- Deny
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|||||||
228
api/krusty/no_list_items_test.go
Normal file
228
api/krusty/no_list_items_test.go
Normal file
@@ -0,0 +1,228 @@
|
|||||||
|
// Copyright 2019 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package krusty_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
|
)
|
||||||
|
|
||||||
|
// test for https://github.com/kubernetes-sigs/kustomize/issues/4240
|
||||||
|
func TestSuffix5042(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- resource.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("resource.yaml", `
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResource
|
||||||
|
metadata:
|
||||||
|
name: service
|
||||||
|
---
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResourceTwo
|
||||||
|
metadata:
|
||||||
|
name: test
|
||||||
|
rules: []
|
||||||
|
`)
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResource
|
||||||
|
metadata:
|
||||||
|
name: service
|
||||||
|
---
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResourceTwo
|
||||||
|
metadata:
|
||||||
|
name: test
|
||||||
|
rules: []
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestListSuffix5042(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- resource.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("resource.yaml", `
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResource
|
||||||
|
metadata:
|
||||||
|
name: service
|
||||||
|
---
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResourceList
|
||||||
|
metadata:
|
||||||
|
name: test
|
||||||
|
rules: []
|
||||||
|
`)
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResource
|
||||||
|
metadata:
|
||||||
|
name: service
|
||||||
|
---
|
||||||
|
apiVersion: example.com/v1alpha1
|
||||||
|
kind: MyResourceList
|
||||||
|
metadata:
|
||||||
|
name: test
|
||||||
|
rules: []
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestListSuffix5485(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- resource.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("resource.yaml", `
|
||||||
|
apiVersion: infra.protonbase.io/v1alpha1
|
||||||
|
kind: AccessWhiteList
|
||||||
|
metadata:
|
||||||
|
name: wlmls5769f
|
||||||
|
namespace: dc7i4hyxzw
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- sourceIps: 0.0.0.0/16
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: infra.protonbase.io/v1alpha1
|
||||||
|
kind: AccessWhiteList
|
||||||
|
metadata:
|
||||||
|
name: wlmls5769f
|
||||||
|
namespace: dc7i4hyxzw
|
||||||
|
spec:
|
||||||
|
rules:
|
||||||
|
- sourceIps: 0.0.0.0/16
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestListToIndividualResources(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- list.yaml
|
||||||
|
`)
|
||||||
|
|
||||||
|
th.WriteF("list.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PodList
|
||||||
|
items:
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: my-pod-1
|
||||||
|
namespace: default
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: my-container
|
||||||
|
image: nginx:1.19.10
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: my-pod-2
|
||||||
|
namespace: default
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: my-container
|
||||||
|
image: nginx:1.19.10
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
- apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: my-pod-3
|
||||||
|
namespace: default
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: my-container
|
||||||
|
image: nginx:1.19.10
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
`)
|
||||||
|
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
|
||||||
|
th.AssertActualEqualsExpected(m, `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
name: my-pod-1
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: nginx:1.19.10
|
||||||
|
name: my-container
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
name: my-pod-2
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: nginx:1.19.10
|
||||||
|
name: my-container
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: my-app
|
||||||
|
name: my-pod-3
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- image: nginx:1.19.10
|
||||||
|
name: my-container
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
|
`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Empty list should result in no resources
|
||||||
|
func TestEmptyList(t *testing.T) {
|
||||||
|
th := kusttest_test.MakeHarness(t)
|
||||||
|
th.WriteK(".", `
|
||||||
|
resources:
|
||||||
|
- emptyList.yaml
|
||||||
|
`)
|
||||||
|
th.WriteF("emptyList.yaml", `
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PodList
|
||||||
|
items: []
|
||||||
|
`)
|
||||||
|
m := th.Run(".", th.MakeDefaultOptions())
|
||||||
|
th.AssertActualEqualsExpected(m, "")
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
"sigs.k8s.io/kustomize/kyaml/openapi"
|
"sigs.k8s.io/kustomize/kyaml/openapi"
|
||||||
"sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi"
|
"sigs.k8s.io/kustomize/kyaml/openapi/kubernetesapi"
|
||||||
@@ -264,7 +265,7 @@ openapi:
|
|||||||
writeCustomResource(th, "mycrd.yaml")
|
writeCustomResource(th, "mycrd.yaml")
|
||||||
writeTestSchema(th, "./")
|
writeTestSchema(th, "./")
|
||||||
err := th.RunWithErr(".", th.MakeDefaultOptions())
|
err := th.RunWithErr(".", th.MakeDefaultOptions())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
"builtin version and custom schema provided, cannot use both",
|
"builtin version and custom schema provided, cannot use both",
|
||||||
err.Error())
|
err.Error())
|
||||||
@@ -284,7 +285,7 @@ openapi:
|
|||||||
`+customSchemaPatch)
|
`+customSchemaPatch)
|
||||||
writeCustomResource(th, "mycrd.yaml")
|
writeCustomResource(th, "mycrd.yaml")
|
||||||
err := th.RunWithErr(".", th.MakeDefaultOptions())
|
err := th.RunWithErr(".", th.MakeDefaultOptions())
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
"'/mycrd_schema.json' doesn't exist",
|
"'/mycrd_schema.json' doesn't exist",
|
||||||
err.Error())
|
err.Error())
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/internal/utils"
|
"sigs.k8s.io/kustomize/api/internal/utils"
|
||||||
"sigs.k8s.io/kustomize/api/krusty"
|
"sigs.k8s.io/kustomize/api/krusty"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
@@ -417,7 +418,7 @@ func TestAnnoOriginCustomExecGenerator(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -443,7 +444,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -456,9 +457,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -500,7 +501,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginCustomInlineExecGenerator(t *testing.T) {
|
func TestAnnoOriginCustomInlineExecGenerator(t *testing.T) {
|
||||||
@@ -511,7 +512,7 @@ func TestAnnoOriginCustomInlineExecGenerator(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -544,11 +545,11 @@ stringData:
|
|||||||
- mkdir /mnt/vda
|
- mkdir /mnt/vda
|
||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -590,7 +591,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginCustomExecGeneratorWithOverlay(t *testing.T) {
|
func TestAnnoOriginCustomExecGeneratorWithOverlay(t *testing.T) {
|
||||||
@@ -601,11 +602,11 @@ func TestAnnoOriginCustomExecGeneratorWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -633,7 +634,7 @@ stringData:
|
|||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -646,9 +647,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -690,7 +691,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginCustomInlineExecGeneratorWithOverlay(t *testing.T) {
|
func TestAnnoOriginCustomInlineExecGeneratorWithOverlay(t *testing.T) {
|
||||||
@@ -701,11 +702,11 @@ func TestAnnoOriginCustomInlineExecGeneratorWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
resources:
|
resources:
|
||||||
- short_secret.yaml
|
- short_secret.yaml
|
||||||
@@ -740,11 +741,11 @@ stringData:
|
|||||||
- mkdir /mnt/vda
|
- mkdir /mnt/vda
|
||||||
`)
|
`)
|
||||||
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata:
|
||||||
@@ -786,15 +787,15 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginRemoteBuiltinGenerator(t *testing.T) {
|
func TestAnnoOriginRemoteBuiltinGenerator(t *testing.T) {
|
||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
|
b := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
resources:
|
resources:
|
||||||
- github.com/kubernetes-sigs/kustomize/examples/ldap/base/?ref=v1.0.6
|
- github.com/kubernetes-sigs/kustomize/examples/ldap/base/?ref=v1.0.6
|
||||||
buildMetadata: [originAnnotations]
|
buildMetadata: [originAnnotations]
|
||||||
@@ -810,7 +811,7 @@ buildMetadata: [originAnnotations]
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Contains(t, string(yml), `kind: ConfigMap
|
assert.Contains(t, string(yml), `kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
@@ -822,7 +823,7 @@ metadata:
|
|||||||
apiVersion: builtin
|
apiVersion: builtin
|
||||||
kind: ConfigMapGenerator
|
kind: ConfigMapGenerator
|
||||||
name: ldap-configmap-4d7m6k5b42`)
|
name: ldap-configmap-4d7m6k5b42`)
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginInlineBuiltinGenerator(t *testing.T) {
|
func TestAnnoOriginInlineBuiltinGenerator(t *testing.T) {
|
||||||
@@ -1011,7 +1012,7 @@ func TestAnnoOriginGeneratorInTransformersField(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
transformers:
|
transformers:
|
||||||
- gener.yaml
|
- gener.yaml
|
||||||
@@ -1020,7 +1021,7 @@ buildMetadata: [originAnnotations]
|
|||||||
|
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1033,9 +1034,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1062,7 +1063,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginGeneratorInTransformersFieldWithOverlay(t *testing.T) {
|
func TestAnnoOriginGeneratorInTransformersFieldWithOverlay(t *testing.T) {
|
||||||
@@ -1073,11 +1074,11 @@ func TestAnnoOriginGeneratorInTransformersFieldWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
|
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
transformers:
|
transformers:
|
||||||
@@ -1086,7 +1087,7 @@ transformers:
|
|||||||
|
|
||||||
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
th.WriteF(filepath.Join(base, "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1105,9 +1106,9 @@ buildMetadata: [originAnnotations, transformerAnnotations]
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1139,5 +1140,5 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ resources:
|
|||||||
require.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), test.err)
|
assert.Contains(t, err.Error(), test.err)
|
||||||
if test.errT != nil {
|
if test.errT != nil {
|
||||||
assert.ErrorIs(t, err, test.errT)
|
require.ErrorIs(t, err, test.errT)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
@@ -453,6 +453,6 @@ func checkYaml(t *testing.T, actual resmap.ResMap, expected string) {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
yml, err := actual.AsYaml()
|
yml, err := actual.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expected, string(yml))
|
assert.Equal(t, expected, string(yml))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/internal/utils"
|
"sigs.k8s.io/kustomize/api/internal/utils"
|
||||||
"sigs.k8s.io/kustomize/api/krusty"
|
"sigs.k8s.io/kustomize/api/krusty"
|
||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
@@ -261,8 +262,8 @@ func TestAnnoOriginRemoteBuiltinTransformer(t *testing.T) {
|
|||||||
fSys := filesys.MakeFsOnDisk()
|
fSys := filesys.MakeFsOnDisk()
|
||||||
b := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
|
b := krusty.MakeKustomizer(krusty.MakeDefaultOptions())
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
require.NoError(t, fSys.WriteFile(filepath.Join(tmpDir.String(), "kustomization.yaml"), []byte(`
|
||||||
resources:
|
resources:
|
||||||
- github.com/kubernetes-sigs/kustomize/examples/multibases/production/?ref=v1.0.6
|
- github.com/kubernetes-sigs/kustomize/examples/multibases/production/?ref=v1.0.6
|
||||||
buildMetadata: [transformerAnnotations]
|
buildMetadata: [transformerAnnotations]
|
||||||
@@ -278,7 +279,7 @@ buildMetadata: [transformerAnnotations]
|
|||||||
t.FailNow()
|
t.FailNow()
|
||||||
}
|
}
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Pod
|
kind: Pod
|
||||||
metadata:
|
metadata:
|
||||||
@@ -298,7 +299,7 @@ spec:
|
|||||||
- image: nginx:1.7.9
|
- image: nginx:1.7.9
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoTransformerBuiltinInline(t *testing.T) {
|
func TestAnnoTransformerBuiltinInline(t *testing.T) {
|
||||||
@@ -356,7 +357,7 @@ func TestAnnoOriginCustomInlineTransformer(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
th.WriteK(tmpDir.String(), `
|
th.WriteK(tmpDir.String(), `
|
||||||
transformers:
|
transformers:
|
||||||
- |-
|
- |-
|
||||||
@@ -375,7 +376,7 @@ buildMetadata: [transformerAnnotations]
|
|||||||
// which will cause kustomize to record the plugin origin data as a transformation
|
// which will cause kustomize to record the plugin origin data as a transformation
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentWithOriginDotSh)
|
th.WriteF(filepath.Join(tmpDir.String(), "generateDeployment.sh"), generateDeploymentWithOriginDotSh)
|
||||||
|
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(tmpDir.String(), "generateDeployment.sh"), 0777))
|
||||||
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
th.WriteF(filepath.Join(tmpDir.String(), "gener.yaml"), `
|
||||||
kind: executable
|
kind: executable
|
||||||
metadata:
|
metadata:
|
||||||
@@ -388,9 +389,9 @@ spec:
|
|||||||
`)
|
`)
|
||||||
|
|
||||||
m := th.Run(tmpDir.String(), o)
|
m := th.Run(tmpDir.String(), o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -417,7 +418,7 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAnnoOriginCustomExecTransformerWithOverlay(t *testing.T) {
|
func TestAnnoOriginCustomExecTransformerWithOverlay(t *testing.T) {
|
||||||
@@ -428,11 +429,11 @@ func TestAnnoOriginCustomExecTransformerWithOverlay(t *testing.T) {
|
|||||||
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
o.PluginConfig.FnpLoadingOptions.EnableExec = true
|
||||||
|
|
||||||
tmpDir, err := filesys.NewTmpConfirmedDir()
|
tmpDir, err := filesys.NewTmpConfirmedDir()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
base := filepath.Join(tmpDir.String(), "base")
|
base := filepath.Join(tmpDir.String(), "base")
|
||||||
prod := filepath.Join(tmpDir.String(), "prod")
|
prod := filepath.Join(tmpDir.String(), "prod")
|
||||||
assert.NoError(t, fSys.Mkdir(base))
|
require.NoError(t, fSys.Mkdir(base))
|
||||||
assert.NoError(t, fSys.Mkdir(prod))
|
require.NoError(t, fSys.Mkdir(prod))
|
||||||
th.WriteK(base, `
|
th.WriteK(base, `
|
||||||
transformers:
|
transformers:
|
||||||
- gener.yaml
|
- gener.yaml
|
||||||
@@ -455,12 +456,12 @@ spec:
|
|||||||
// generateDeploymentWithOriginDotSh creates a resource that already has an origin annotation,
|
// generateDeploymentWithOriginDotSh creates a resource that already has an origin annotation,
|
||||||
// which will cause kustomize to record the plugin origin data as a transformation
|
// which will cause kustomize to record the plugin origin data as a transformation
|
||||||
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentWithOriginDotSh)
|
th.WriteF(filepath.Join(base, "generateDeployment.sh"), generateDeploymentWithOriginDotSh)
|
||||||
assert.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
require.NoError(t, os.Chmod(filepath.Join(base, "generateDeployment.sh"), 0777))
|
||||||
|
|
||||||
m := th.Run(prod, o)
|
m := th.Run(prod, o)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -487,5 +488,5 @@ spec:
|
|||||||
- image: nginx
|
- image: nginx
|
||||||
name: nginx
|
name: nginx
|
||||||
`, string(yml))
|
`, string(yml))
|
||||||
assert.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
require.NoError(t, fSys.RemoveAll(tmpDir.String()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -377,7 +377,8 @@ spec:
|
|||||||
th.WriteF("base/config/knative.yaml", `
|
th.WriteF("base/config/knative.yaml", `
|
||||||
images:
|
images:
|
||||||
- path: spec/runLatest/configuration/revisionTemplate/spec/container/image
|
- path: spec/runLatest/configuration/revisionTemplate/spec/container/image
|
||||||
apiVersion: serving.knative.dev/v1alpha1
|
group: serving.knative.dev
|
||||||
|
version: v1alpha1
|
||||||
kind: Service
|
kind: Service
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ vars:
|
|||||||
objref: &config-map-ref
|
objref: &config-map-ref
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
name: kustomize-vars
|
name: kustomize-vars
|
||||||
apiVersion: v1
|
version: v1
|
||||||
fieldref:
|
fieldref:
|
||||||
fieldpath: data.DBT_TARGET
|
fieldpath: data.DBT_TARGET
|
||||||
- name: SUSPENDED
|
- name: SUSPENDED
|
||||||
@@ -500,10 +500,12 @@ nameReference:
|
|||||||
varReference:
|
varReference:
|
||||||
- path: spec/workflowSpec/arguments/parameters/value
|
- path: spec/workflowSpec/arguments/parameters/value
|
||||||
kind: CronWorkflow
|
kind: CronWorkflow
|
||||||
apiVersion: argoproj.io/v1alpha1
|
group: argoproj.io
|
||||||
|
version: v1alpha1
|
||||||
- path: spec
|
- path: spec
|
||||||
kind: CronWorkflow
|
kind: CronWorkflow
|
||||||
apiVersion: argoproj.io/v1alpha1
|
group: argoproj.io
|
||||||
|
version: v1alpha1
|
||||||
`)
|
`)
|
||||||
th.WriteF("vars.env", `
|
th.WriteF("vars.env", `
|
||||||
DBT_TARGET=development
|
DBT_TARGET=development
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import (
|
|||||||
|
|
||||||
// TODO: delete this when we find a better way to generate release notes.
|
// TODO: delete this when we find a better way to generate release notes.
|
||||||
func main() {
|
func main() {
|
||||||
fmt.Println(`
|
fmt.Println(`This 'main' exists only to create release notes for the API.`)
|
||||||
This 'main' exists only to make goreleaser create release notes for the API.
|
|
||||||
See https://github.com/goreleaser/goreleaser/issues/981
|
|
||||||
and https://github.com/kubernetes-sigs/kustomize/tree/master/releasing`)
|
|
||||||
fmt.Println(provenance.GetProvenance())
|
fmt.Println(provenance.GetProvenance())
|
||||||
}
|
}
|
||||||
|
|||||||
13
api/pkg/util/image.go
Normal file
13
api/pkg/util/image.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright 2024 The Kubernetes Authors.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
package util
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sigs.k8s.io/kustomize/api/internal/image"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Splits image string name into name, tag and digest
|
||||||
|
func SplitImageName(imageName string) (name string, tag string, digest string) {
|
||||||
|
return image.Split(imageName)
|
||||||
|
}
|
||||||
@@ -8,6 +8,8 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/blang/semver/v4"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These variables are set at build time using ldflags.
|
// These variables are set at build time using ldflags.
|
||||||
@@ -62,9 +64,42 @@ func GetProvenance() Provenance {
|
|||||||
p.GitCommit = setting.Value
|
p.GitCommit = setting.Value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, dep := range info.Deps {
|
||||||
|
if dep != nil && dep.Path == "sigs.k8s.io/kustomize/kustomize/v5" {
|
||||||
|
if dep.Version != "devel" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
v, err := GetMostRecentTag(*dep)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("failed to get most recent tag for %s: %v\n", dep.Path, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
p.Version = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetMostRecentTag(m debug.Module) (string, error) {
|
||||||
|
for m.Replace != nil {
|
||||||
|
m = *m.Replace
|
||||||
|
}
|
||||||
|
|
||||||
|
split := strings.Split(m.Version, "-")
|
||||||
|
sv, err := semver.Parse(strings.TrimPrefix(split[0], "v"))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("failed to parse version %s: %w", m.Version, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(split) > 1 && sv.Patch > 0 {
|
||||||
|
sv.Patch -= 1
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("v%s", sv.FinalizeVersion()), nil
|
||||||
|
}
|
||||||
|
|
||||||
// Short returns the shortened provenance stamp.
|
// Short returns the shortened provenance stamp.
|
||||||
func (v Provenance) Short() string {
|
func (v Provenance) Short() string {
|
||||||
return fmt.Sprintf(
|
return fmt.Sprintf(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package provenance_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime/debug"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@@ -45,3 +46,59 @@ func TestProvenance_Semver(t *testing.T) {
|
|||||||
p.Version = "kustomize/v4.11.12"
|
p.Version = "kustomize/v4.11.12"
|
||||||
assert.Equal(t, "v4.11.12", p.Semver())
|
assert.Equal(t, "v4.11.12", p.Semver())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func mockModule(version string) debug.Module {
|
||||||
|
return debug.Module{
|
||||||
|
Path: "sigs.k8s.io/kustomize/kustomize/v5",
|
||||||
|
Version: version,
|
||||||
|
Replace: nil,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetMostRecentTag(t *testing.T) {
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
module debug.Module
|
||||||
|
isError bool
|
||||||
|
expectedTag string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "Standard version",
|
||||||
|
module: mockModule("v1.2.3"),
|
||||||
|
expectedTag: "v1.2.3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Pseudo-version with patch increment",
|
||||||
|
module: mockModule("v0.0.0-20210101010101-abcdefabcdef"),
|
||||||
|
expectedTag: "v0.0.0",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Invalid semver string",
|
||||||
|
module: mockModule("invalid-version"),
|
||||||
|
isError: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Valid semver with patch increment and pre-release info",
|
||||||
|
module: mockModule("v1.2.3-0.20210101010101-abcdefabcdef"),
|
||||||
|
expectedTag: "v1.2.2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Valid semver no patch increment",
|
||||||
|
module: mockModule("v1.2.0"),
|
||||||
|
expectedTag: "v1.2.0",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, tt := range tests {
|
||||||
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
tag, err := provenance.GetMostRecentTag(tt.module)
|
||||||
|
if err != nil {
|
||||||
|
if !tt.isError {
|
||||||
|
assert.NoError(t, err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
assert.Equal(t, tt.expectedTag, tag)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/ifc"
|
"sigs.k8s.io/kustomize/api/ifc"
|
||||||
loader "sigs.k8s.io/kustomize/api/internal/loader"
|
loader "sigs.k8s.io/kustomize/api/internal/loader"
|
||||||
"sigs.k8s.io/kustomize/api/kv"
|
"sigs.k8s.io/kustomize/api/kv"
|
||||||
@@ -61,19 +62,19 @@ metadata:
|
|||||||
"namespace": "test",
|
"namespace": "test",
|
||||||
}}).ResMap()
|
}}).ResMap()
|
||||||
expYaml, err := expected.AsYaml()
|
expYaml, err := expected.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
fSys := filesys.MakeFsInMemory()
|
fSys := filesys.MakeFsInMemory()
|
||||||
assert.NoError(t, fSys.WriteFile("deployment.yaml", []byte(resourceStr)))
|
require.NoError(t, fSys.WriteFile("deployment.yaml", []byte(resourceStr)))
|
||||||
|
|
||||||
ldr, err := loader.NewLoader(
|
ldr, err := loader.NewLoader(
|
||||||
loader.RestrictionRootOnly, filesys.Separator, fSys)
|
loader.RestrictionRootOnly, filesys.Separator, fSys)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
m, err := rmF.FromFile(ldr, "deployment.yaml")
|
m, err := rmF.FromFile(ldr, "deployment.yaml")
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
mYaml, err := m.AsYaml()
|
mYaml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expYaml, mYaml)
|
assert.Equal(t, expYaml, mYaml)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,11 +103,11 @@ metadata:
|
|||||||
"name": "cm2",
|
"name": "cm2",
|
||||||
}}).ResMap()
|
}}).ResMap()
|
||||||
expYaml, err := expected.AsYaml()
|
expYaml, err := expected.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
m, err := rmF.NewResMapFromBytes(encoded)
|
m, err := rmF.NewResMapFromBytes(encoded)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
mYaml, err := m.AsYaml()
|
mYaml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expYaml, mYaml)
|
assert.Equal(t, expYaml, mYaml)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,13 +220,13 @@ BAR=baz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
r, err := rmF.NewResMapFromConfigMapArgs(kvLdr, tc.input)
|
r, err := rmF.NewResMapFromConfigMapArgs(kvLdr, tc.input)
|
||||||
assert.NoError(t, err, tc.description)
|
require.NoError(t, err, tc.description)
|
||||||
r.RemoveBuildAnnotations()
|
r.RemoveBuildAnnotations()
|
||||||
rYaml, err := r.AsYaml()
|
rYaml, err := r.AsYaml()
|
||||||
assert.NoError(t, err, tc.description)
|
require.NoError(t, err, tc.description)
|
||||||
tc.expected.RemoveBuildAnnotations()
|
tc.expected.RemoveBuildAnnotations()
|
||||||
expYaml, err := tc.expected.AsYaml()
|
expYaml, err := tc.expected.AsYaml()
|
||||||
assert.NoError(t, err, tc.description)
|
require.NoError(t, err, tc.description)
|
||||||
assert.Equal(t, expYaml, rYaml)
|
assert.Equal(t, expYaml, rYaml)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,7 +258,7 @@ func TestNewResMapFromSecretArgs(t *testing.T) {
|
|||||||
}
|
}
|
||||||
actual.RemoveBuildAnnotations()
|
actual.RemoveBuildAnnotations()
|
||||||
actYaml, err := actual.AsYaml()
|
actYaml, err := actual.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
expected := resmaptest_test.NewRmBuilder(t, rf).Add(
|
expected := resmaptest_test.NewRmBuilder(t, rf).Add(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
@@ -273,7 +274,7 @@ func TestNewResMapFromSecretArgs(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}).ResMap()
|
}).ResMap()
|
||||||
expYaml, err := expected.AsYaml()
|
expYaml, err := expected.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
assert.Equal(t, string(expYaml), string(actYaml))
|
assert.Equal(t, string(expYaml), string(actYaml))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/filters/labels"
|
"sigs.k8s.io/kustomize/api/filters/labels"
|
||||||
"sigs.k8s.io/kustomize/api/provider"
|
"sigs.k8s.io/kustomize/api/provider"
|
||||||
. "sigs.k8s.io/kustomize/api/resmap"
|
. "sigs.k8s.io/kustomize/api/resmap"
|
||||||
@@ -72,7 +73,7 @@ func doRemove(t *testing.T, w ResMap, id resid.ResId) {
|
|||||||
|
|
||||||
// Make a resource with a predictable name.
|
// Make a resource with a predictable name.
|
||||||
func makeCm(i int) *resource.Resource {
|
func makeCm(i int) *resource.Resource {
|
||||||
return rf.FromMap(
|
r, err := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -80,6 +81,10 @@ func makeCm(i int) *resource.Resource {
|
|||||||
"name": fmt.Sprintf("cm%03d", i),
|
"name": fmt.Sprintf("cm%03d", i),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maintain the class invariant that no two
|
// Maintain the class invariant that no two
|
||||||
@@ -228,7 +233,7 @@ metadata:
|
|||||||
func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
||||||
cmap := resid.NewGvk("", "v1", "ConfigMap")
|
cmap := resid.NewGvk("", "v1", "ConfigMap")
|
||||||
|
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -236,7 +241,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
"name": "alice",
|
"name": "alice",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r2 := rf.FromMap(
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -244,7 +252,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
"name": "bob",
|
"name": "bob",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r3 := rf.FromMap(
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
|
r3, err3 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -253,7 +264,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r4 := rf.FromMap(
|
if err3 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err3)
|
||||||
|
}
|
||||||
|
r4, err4 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -262,7 +276,10 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r5 := rf.FromMap(
|
if err4 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err4)
|
||||||
|
}
|
||||||
|
r5, err5 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -271,6 +288,9 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err5 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err5)
|
||||||
|
}
|
||||||
|
|
||||||
m := resmaptest_test.NewRmBuilder(t, rf).
|
m := resmaptest_test.NewRmBuilder(t, rf).
|
||||||
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
||||||
@@ -366,7 +386,7 @@ func TestGetMatchingResourcesByCurrentId(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -379,7 +399,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r2 := rf.FromMap(
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -392,7 +415,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r3 := rf.FromMap(
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
|
r3, err3 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -406,7 +432,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r4 := rf.FromMap(
|
if err3 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err3)
|
||||||
|
}
|
||||||
|
r4, err4 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -420,7 +449,10 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r5 := rf.FromMap(
|
if err4 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err4)
|
||||||
|
}
|
||||||
|
r5, err5 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -429,6 +461,9 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err5 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err5)
|
||||||
|
}
|
||||||
|
|
||||||
m := resmaptest_test.NewRmBuilder(t, rf).
|
m := resmaptest_test.NewRmBuilder(t, rf).
|
||||||
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
AddR(r1).AddR(r2).AddR(r3).AddR(r4).AddR(r5).ResMap()
|
||||||
@@ -497,7 +532,7 @@ func TestGetMatchingResourcesByAnyId(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -505,7 +540,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"name": "alice",
|
"name": "alice",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r2 := rf.FromMap(
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -513,7 +551,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"name": "bob",
|
"name": "bob",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r3 := rf.FromMap(
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
|
r3, err3 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -522,7 +563,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r4 := rf.FromMap(
|
if err3 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err3)
|
||||||
|
}
|
||||||
|
r4, err4 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -531,7 +575,10 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r5 := rf.FromMap(
|
if err4 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err4)
|
||||||
|
}
|
||||||
|
r5, err5 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -540,8 +587,11 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err5 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err5)
|
||||||
|
}
|
||||||
r5.AddNamePrefix("little-")
|
r5.AddNamePrefix("little-")
|
||||||
r6 := rf.FromMap(
|
r6, err6 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -550,8 +600,11 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"namespace": "happy",
|
"namespace": "happy",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err6 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err6)
|
||||||
|
}
|
||||||
r6.AddNamePrefix("little-")
|
r6.AddNamePrefix("little-")
|
||||||
r7 := rf.FromMap(
|
r7, err7 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "rbac.authorization.k8s.io/v1",
|
"apiVersion": "rbac.authorization.k8s.io/v1",
|
||||||
"kind": "ClusterRoleBinding",
|
"kind": "ClusterRoleBinding",
|
||||||
@@ -559,6 +612,9 @@ func TestSubsetThatCouldBeReferencedByResource(t *testing.T) {
|
|||||||
"name": "meh",
|
"name": "meh",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err7 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err7)
|
||||||
|
}
|
||||||
|
|
||||||
tests := map[string]struct {
|
tests := map[string]struct {
|
||||||
filter *resource.Resource
|
filter *resource.Resource
|
||||||
@@ -638,7 +694,7 @@ func TestDeepCopy(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestErrorIfNotEqualSets(t *testing.T) {
|
func TestErrorIfNotEqualSets(t *testing.T) {
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -646,7 +702,10 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
|||||||
"name": "cm1",
|
"name": "cm1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r2 := rf.FromMap(
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -654,7 +713,10 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
|||||||
"name": "cm2",
|
"name": "cm2",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r3 := rf.FromMap(
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
|
r3, err3 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -663,6 +725,9 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
|||||||
"namespace": "system",
|
"namespace": "system",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err3 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err3)
|
||||||
|
}
|
||||||
|
|
||||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
||||||
if err := m1.ErrorIfNotEqualSets(m1); err != nil {
|
if err := m1.ErrorIfNotEqualSets(m1); err != nil {
|
||||||
@@ -711,7 +776,7 @@ func TestErrorIfNotEqualSets(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestErrorIfNotEqualLists(t *testing.T) {
|
func TestErrorIfNotEqualLists(t *testing.T) {
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -719,7 +784,10 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
|||||||
"name": "cm1",
|
"name": "cm1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r2 := rf.FromMap(
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -727,7 +795,10 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
|||||||
"name": "cm2",
|
"name": "cm2",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
r3 := rf.FromMap(
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
|
r3, err3 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "v1",
|
"apiVersion": "v1",
|
||||||
"kind": "ConfigMap",
|
"kind": "ConfigMap",
|
||||||
@@ -736,6 +807,9 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
|||||||
"namespace": "system",
|
"namespace": "system",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err3 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err3)
|
||||||
|
}
|
||||||
|
|
||||||
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
m1 := resmaptest_test.NewRmBuilder(t, rf).AddR(r1).AddR(r2).AddR(r3).ResMap()
|
||||||
if err := m1.ErrorIfNotEqualLists(m1); err != nil {
|
if err := m1.ErrorIfNotEqualLists(m1); err != nil {
|
||||||
@@ -779,7 +853,7 @@ func TestErrorIfNotEqualLists(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestAppendAll(t *testing.T) {
|
func TestAppendAll(t *testing.T) {
|
||||||
r1 := rf.FromMap(
|
r1, err1 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -787,8 +861,11 @@ func TestAppendAll(t *testing.T) {
|
|||||||
"name": "foo-deploy1",
|
"name": "foo-deploy1",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err1 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err1)
|
||||||
|
}
|
||||||
input1 := rmF.FromResource(r1)
|
input1 := rmF.FromResource(r1)
|
||||||
r2 := rf.FromMap(
|
r2, err2 := rf.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "StatefulSet",
|
"kind": "StatefulSet",
|
||||||
@@ -796,6 +873,9 @@ func TestAppendAll(t *testing.T) {
|
|||||||
"name": "bar-stateful",
|
"name": "bar-stateful",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err2 != nil {
|
||||||
|
t.Fatalf("failed to get new instance: %v", err2)
|
||||||
|
}
|
||||||
input2 := rmF.FromResource(r2)
|
input2 := rmF.FromResource(r2)
|
||||||
|
|
||||||
expected := New()
|
expected := New()
|
||||||
@@ -891,21 +971,21 @@ func TestAbsorbAll(t *testing.T) {
|
|||||||
}
|
}
|
||||||
expected := rmF.FromResource(r)
|
expected := rmF.FromResource(r)
|
||||||
w := makeMap1(t)
|
w := makeMap1(t)
|
||||||
assert.NoError(t, w.AbsorbAll(makeMap2(t, types.BehaviorMerge)))
|
require.NoError(t, w.AbsorbAll(makeMap2(t, types.BehaviorMerge)))
|
||||||
expected.RemoveBuildAnnotations()
|
expected.RemoveBuildAnnotations()
|
||||||
w.RemoveBuildAnnotations()
|
w.RemoveBuildAnnotations()
|
||||||
assert.NoError(t, expected.ErrorIfNotEqualLists(w))
|
require.NoError(t, expected.ErrorIfNotEqualLists(w))
|
||||||
w = makeMap1(t)
|
w = makeMap1(t)
|
||||||
assert.NoError(t, w.AbsorbAll(nil))
|
require.NoError(t, w.AbsorbAll(nil))
|
||||||
assert.NoError(t, w.ErrorIfNotEqualLists(makeMap1(t)))
|
require.NoError(t, w.ErrorIfNotEqualLists(makeMap1(t)))
|
||||||
|
|
||||||
w = makeMap1(t)
|
w = makeMap1(t)
|
||||||
w2 := makeMap2(t, types.BehaviorReplace)
|
w2 := makeMap2(t, types.BehaviorReplace)
|
||||||
assert.NoError(t, w.AbsorbAll(w2))
|
require.NoError(t, w.AbsorbAll(w2))
|
||||||
w2.RemoveBuildAnnotations()
|
w2.RemoveBuildAnnotations()
|
||||||
assert.NoError(t, w2.ErrorIfNotEqualLists(w))
|
require.NoError(t, w2.ErrorIfNotEqualLists(w))
|
||||||
err = makeMap1(t).AbsorbAll(makeMap2(t, types.BehaviorUnspecified))
|
err = makeMap1(t).AbsorbAll(makeMap2(t, types.BehaviorUnspecified))
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.True(
|
assert.True(
|
||||||
t, strings.Contains(err.Error(), "behavior must be merge or replace"))
|
t, strings.Contains(err.Error(), "behavior must be merge or replace"))
|
||||||
}
|
}
|
||||||
@@ -957,10 +1037,10 @@ data:
|
|||||||
feeling: *color-used
|
feeling: *color-used
|
||||||
`
|
`
|
||||||
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, rm.DeAnchor())
|
require.NoError(t, rm.DeAnchor())
|
||||||
yaml, err := rm.AsYaml()
|
yaml, err := rm.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, strings.TrimSpace(`
|
assert.Equal(t, strings.TrimSpace(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
@@ -991,10 +1071,10 @@ spec:
|
|||||||
<<: *probe
|
<<: *probe
|
||||||
`
|
`
|
||||||
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, rm.DeAnchor())
|
require.NoError(t, rm.DeAnchor())
|
||||||
yaml, err := rm.AsYaml()
|
yaml, err := rm.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, strings.TrimSpace(`apiVersion: apps/v1
|
assert.Equal(t, strings.TrimSpace(`apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1038,7 +1118,7 @@ data:
|
|||||||
feeling: *color-used
|
feeling: *color-used
|
||||||
`
|
`
|
||||||
_, err := rmF.NewResMapFromBytes([]byte(input))
|
_, err := rmF.NewResMapFromBytes([]byte(input))
|
||||||
assert.Error(t, err)
|
require.Error(t, err)
|
||||||
assert.Contains(t, err.Error(), "unknown anchor 'color-used' referenced")
|
assert.Contains(t, err.Error(), "unknown anchor 'color-used' referenced")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1065,10 +1145,10 @@ items:
|
|||||||
feeling: *color-used
|
feeling: *color-used
|
||||||
`
|
`
|
||||||
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
rm, err := rmF.NewResMapFromBytes([]byte(input))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, rm.DeAnchor())
|
require.NoError(t, rm.DeAnchor())
|
||||||
yaml, err := rm.AsYaml()
|
yaml, err := rm.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, strings.TrimSpace(`
|
assert.Equal(t, strings.TrimSpace(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
@@ -1301,11 +1381,11 @@ spec:
|
|||||||
tc := tests[n]
|
tc := tests[n]
|
||||||
t.Run(n, func(t *testing.T) {
|
t.Run(n, func(t *testing.T) {
|
||||||
m, err := rmF.NewResMapFromBytes([]byte(strings.Join(tc.base, "\n---\n")))
|
m, err := rmF.NewResMapFromBytes([]byte(strings.Join(tc.base, "\n---\n")))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
foundError := false
|
foundError := false
|
||||||
for _, patch := range tc.patches {
|
for _, patch := range tc.patches {
|
||||||
rp, err := rf.FromBytes([]byte(patch))
|
rp, err := rf.FromBytes([]byte(patch))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
idSet := resource.MakeIdSet([]*resource.Resource{rp})
|
idSet := resource.MakeIdSet([]*resource.Resource{rp})
|
||||||
if err = m.ApplySmPatch(idSet, rp); err != nil {
|
if err = m.ApplySmPatch(idSet, rp); err != nil {
|
||||||
foundError = true
|
foundError = true
|
||||||
@@ -1320,7 +1400,7 @@ spec:
|
|||||||
assert.False(t, tc.errorExpected)
|
assert.False(t, tc.errorExpected)
|
||||||
m.RemoveBuildAnnotations()
|
m.RemoveBuildAnnotations()
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, strings.Join(tc.expected, "---\n"), string(yml))
|
assert.Equal(t, strings.Join(tc.expected, "---\n"), string(yml))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1509,8 +1589,8 @@ metadata:
|
|||||||
tc := tests[name]
|
tc := tests[name]
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
m, err := rmF.NewResMapFromBytes([]byte(tc.input))
|
m, err := rmF.NewResMapFromBytes([]byte(tc.input))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, m.ApplyFilter(tc.f))
|
require.NoError(t, m.ApplyFilter(tc.f))
|
||||||
kusttest_test.AssertActualEqualsExpectedWithTweak(
|
kusttest_test.AssertActualEqualsExpectedWithTweak(
|
||||||
t, m, nil, tc.expected)
|
t, m, nil, tc.expected)
|
||||||
})
|
})
|
||||||
@@ -1604,16 +1684,16 @@ $patch: delete
|
|||||||
tc := tests[name]
|
tc := tests[name]
|
||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
m, err := rmF.NewResMapFromBytes([]byte(target))
|
m, err := rmF.NewResMapFromBytes([]byte(target))
|
||||||
assert.NoError(t, err, name)
|
require.NoError(t, err, name)
|
||||||
idSet := resource.MakeIdSet(m.Resources())
|
idSet := resource.MakeIdSet(m.Resources())
|
||||||
assert.Equal(t, 1, idSet.Size(), name)
|
assert.Equal(t, 1, idSet.Size(), name)
|
||||||
p, err := rf.FromBytes([]byte(tc.patch))
|
p, err := rf.FromBytes([]byte(tc.patch))
|
||||||
assert.NoError(t, err, name)
|
require.NoError(t, err, name)
|
||||||
assert.NoError(t, m.ApplySmPatch(idSet, p), name)
|
require.NoError(t, m.ApplySmPatch(idSet, p), name)
|
||||||
assert.Equal(t, tc.finalMapSize, m.Size(), name)
|
assert.Equal(t, tc.finalMapSize, m.Size(), name)
|
||||||
m.RemoveBuildAnnotations()
|
m.RemoveBuildAnnotations()
|
||||||
yml, err := m.AsYaml()
|
yml, err := m.AsYaml()
|
||||||
assert.NoError(t, err, name)
|
require.NoError(t, err, name)
|
||||||
assert.Equal(t, tc.expected, string(yml), name)
|
assert.Equal(t, tc.expected, string(yml), name)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1622,28 +1702,28 @@ $patch: delete
|
|||||||
func TestOriginAnnotations(t *testing.T) {
|
func TestOriginAnnotations(t *testing.T) {
|
||||||
w := New()
|
w := New()
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
assert.NoError(t, w.Append(makeCm(i)))
|
require.NoError(t, w.Append(makeCm(i)))
|
||||||
}
|
}
|
||||||
// this should add an origin annotation to every resource
|
// this should add an origin annotation to every resource
|
||||||
assert.NoError(t, w.AddOriginAnnotation(origin1))
|
require.NoError(t, w.AddOriginAnnotation(origin1))
|
||||||
resources := w.Resources()
|
resources := w.Resources()
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
or, err := res.GetOrigin()
|
or, err := res.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, origin1, or)
|
assert.Equal(t, origin1, or)
|
||||||
}
|
}
|
||||||
// this should not overwrite the existing origin annotations
|
// this should not overwrite the existing origin annotations
|
||||||
assert.NoError(t, w.AddOriginAnnotation(origin2))
|
require.NoError(t, w.AddOriginAnnotation(origin2))
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
or, err := res.GetOrigin()
|
or, err := res.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, origin1, or)
|
assert.Equal(t, origin1, or)
|
||||||
}
|
}
|
||||||
// this should remove origin annotations from all resources
|
// this should remove origin annotations from all resources
|
||||||
assert.NoError(t, w.RemoveOriginAnnotations())
|
require.NoError(t, w.RemoveOriginAnnotations())
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
or, err := res.GetOrigin()
|
or, err := res.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Nil(t, or)
|
assert.Nil(t, or)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1651,31 +1731,31 @@ func TestOriginAnnotations(t *testing.T) {
|
|||||||
func TestTransformerAnnotations(t *testing.T) {
|
func TestTransformerAnnotations(t *testing.T) {
|
||||||
w := New()
|
w := New()
|
||||||
for i := 0; i < 3; i++ {
|
for i := 0; i < 3; i++ {
|
||||||
assert.NoError(t, w.Append(makeCm(i)))
|
require.NoError(t, w.Append(makeCm(i)))
|
||||||
}
|
}
|
||||||
// this should add an origin annotation to every resource
|
// this should add an origin annotation to every resource
|
||||||
assert.NoError(t, w.AddTransformerAnnotation(origin1))
|
require.NoError(t, w.AddTransformerAnnotation(origin1))
|
||||||
resources := w.Resources()
|
resources := w.Resources()
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
or, err := res.GetOrigin()
|
or, err := res.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, origin1, or)
|
assert.Equal(t, origin1, or)
|
||||||
}
|
}
|
||||||
// this should add a transformer annotation to every resource
|
// this should add a transformer annotation to every resource
|
||||||
assert.NoError(t, w.AddTransformerAnnotation(origin2))
|
require.NoError(t, w.AddTransformerAnnotation(origin2))
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
or, err := res.GetOrigin()
|
or, err := res.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, origin1, or)
|
assert.Equal(t, origin1, or)
|
||||||
tr, err := res.GetTransformations()
|
tr, err := res.GetTransformations()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, resource.Transformations{origin2}, tr)
|
assert.Equal(t, resource.Transformations{origin2}, tr)
|
||||||
}
|
}
|
||||||
// remove transformer annotations from all resources
|
// remove transformer annotations from all resources
|
||||||
assert.NoError(t, w.RemoveTransformerAnnotations())
|
require.NoError(t, w.RemoveTransformerAnnotations())
|
||||||
for _, res := range resources {
|
for _, res := range resources {
|
||||||
tr, err := res.GetTransformations()
|
tr, err := res.GetTransformations()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Nil(t, tr)
|
assert.Nil(t, tr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
. "sigs.k8s.io/kustomize/api/resmap"
|
. "sigs.k8s.io/kustomize/api/resmap"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
"sigs.k8s.io/kustomize/kyaml/resid"
|
"sigs.k8s.io/kustomize/kyaml/resid"
|
||||||
@@ -50,7 +51,7 @@ metadata:
|
|||||||
name: x-name1
|
name: x-name1
|
||||||
namespace: x-default
|
namespace: x-default
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +184,7 @@ func TestFindPatchTargets(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for n, testcase := range testcases {
|
for n, testcase := range testcases {
|
||||||
actual, err := rm.Select(testcase.target)
|
actual, err := rm.Select(testcase.target)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equalf(
|
assert.Equalf(
|
||||||
t, testcase.count, len(actual), "test=%s target=%v", n, testcase.target)
|
t, testcase.count, len(actual), "test=%s target=%v", n, testcase.target)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,28 +41,26 @@ func (rf *Factory) Hasher() ifc.KustHasher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FromMap returns a new instance of Resource.
|
// FromMap returns a new instance of Resource.
|
||||||
func (rf *Factory) FromMap(m map[string]interface{}) *Resource {
|
func (rf *Factory) FromMap(m map[string]interface{}) (*Resource, error) {
|
||||||
res, err := rf.FromMapAndOption(m, nil)
|
res, err := rf.FromMapAndOption(m, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: return err instead of log.
|
return nil, fmt.Errorf("failed to create resource from map: %w", err)
|
||||||
log.Fatalf("failed to create resource from map: %v", err)
|
|
||||||
}
|
}
|
||||||
return res
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromMapWithName returns a new instance with the given "original" name.
|
// FromMapWithName returns a new instance with the given "original" name.
|
||||||
func (rf *Factory) FromMapWithName(n string, m map[string]interface{}) *Resource {
|
func (rf *Factory) FromMapWithName(n string, m map[string]interface{}) (*Resource, error) {
|
||||||
return rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m)
|
return rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromMapWithNamespaceAndName returns a new instance with the given "original" namespace.
|
// FromMapWithNamespaceAndName returns a new instance with the given "original" namespace.
|
||||||
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) *Resource {
|
func (rf *Factory) FromMapWithNamespaceAndName(ns string, n string, m map[string]interface{}) (*Resource, error) {
|
||||||
r, err := rf.FromMapAndOption(m, nil)
|
r, err := rf.FromMapAndOption(m, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: return err instead of log.
|
return nil, fmt.Errorf("failed to create resource from map: %w", err)
|
||||||
log.Fatalf("failed to create resource from map: %v", err)
|
|
||||||
}
|
}
|
||||||
return r.setPreviousId(ns, n, r.GetKind())
|
return r.setPreviousId(ns, n, r.GetKind()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// FromMapAndOption returns a new instance of Resource with given options.
|
// FromMapAndOption returns a new instance of Resource with given options.
|
||||||
@@ -204,7 +202,10 @@ func (rf *Factory) inlineAnyEmbeddedLists(
|
|||||||
}
|
}
|
||||||
items, ok := m["items"]
|
items, ok := m["items"]
|
||||||
if !ok {
|
if !ok {
|
||||||
// treat as an empty list
|
// Items field is not present.
|
||||||
|
// This is not a collections resource.
|
||||||
|
// read more https://kubernetes.io/docs/reference/using-api/api-concepts/#collections
|
||||||
|
result = append(result, n0)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
slice, ok := items.([]interface{})
|
slice, ok := items.([]interface{})
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/internal/loader"
|
"sigs.k8s.io/kustomize/api/internal/loader"
|
||||||
. "sigs.k8s.io/kustomize/api/resource"
|
. "sigs.k8s.io/kustomize/api/resource"
|
||||||
"sigs.k8s.io/kustomize/api/types"
|
"sigs.k8s.io/kustomize/api/types"
|
||||||
@@ -273,24 +274,43 @@ kind: List
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
testDeploymentA := factory.FromMap(
|
deploymentA := "deployment-a"
|
||||||
|
testDeploymentA, errA := factory.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "deployment-a",
|
"name": deploymentA,
|
||||||
},
|
},
|
||||||
"spec": testDeploymentSpec,
|
"spec": testDeploymentSpec,
|
||||||
})
|
})
|
||||||
testDeploymentB := factory.FromMap(
|
if errA != nil {
|
||||||
|
t.Fatalf("failed to create new instance with %v: %v", deploymentA, errA)
|
||||||
|
}
|
||||||
|
deploymentB := "deployment-b"
|
||||||
|
testDeploymentB, errB := factory.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"name": "deployment-b",
|
"name": deploymentB,
|
||||||
},
|
},
|
||||||
"spec": testDeploymentSpec,
|
"spec": testDeploymentSpec,
|
||||||
})
|
})
|
||||||
|
if errB != nil {
|
||||||
|
t.Fatalf("failed to create new instance with %v: %v", deploymentB, errB)
|
||||||
|
}
|
||||||
|
|
||||||
|
deploymentNoItems := "deployment-no-items"
|
||||||
|
testDeploymentNoItems, errNoItems := factory.FromMap(
|
||||||
|
map[string]interface{}{
|
||||||
|
"apiVersion": "v1",
|
||||||
|
"kind": "List",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
if errNoItems != nil {
|
||||||
|
t.Fatalf("failed to create new instance with %v: %v", deploymentNoItems, testDeploymentNoItems)
|
||||||
|
}
|
||||||
|
|
||||||
fSys := filesys.MakeFsInMemory()
|
fSys := filesys.MakeFsInMemory()
|
||||||
fSys.WriteFile(string(patchGood1), []byte(patch1))
|
fSys.WriteFile(string(patchGood1), []byte(patch1))
|
||||||
@@ -307,6 +327,16 @@ kind: List
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test deployment: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test config: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
tests := map[string]struct {
|
tests := map[string]struct {
|
||||||
input []types.PatchStrategicMerge
|
input []types.PatchStrategicMerge
|
||||||
expectedOut []*Resource
|
expectedOut []*Resource
|
||||||
@@ -314,7 +344,7 @@ kind: List
|
|||||||
}{
|
}{
|
||||||
"happy": {
|
"happy": {
|
||||||
input: []types.PatchStrategicMerge{patchGood1, patchGood2},
|
input: []types.PatchStrategicMerge{patchGood1, patchGood2},
|
||||||
expectedOut: []*Resource{testDeployment, testConfigMap},
|
expectedOut: []*Resource{td, tc},
|
||||||
expectedErr: false,
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
"badFileName": {
|
"badFileName": {
|
||||||
@@ -329,7 +359,7 @@ kind: List
|
|||||||
},
|
},
|
||||||
"listOfPatches": {
|
"listOfPatches": {
|
||||||
input: []types.PatchStrategicMerge{patchList},
|
input: []types.PatchStrategicMerge{patchList},
|
||||||
expectedOut: []*Resource{testDeployment, testConfigMap},
|
expectedOut: []*Resource{td, tc},
|
||||||
expectedErr: false,
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
"listWithAnchorReference": {
|
"listWithAnchorReference": {
|
||||||
@@ -344,7 +374,7 @@ kind: List
|
|||||||
},
|
},
|
||||||
"listWithNoItems": {
|
"listWithNoItems": {
|
||||||
input: []types.PatchStrategicMerge{patchList4},
|
input: []types.PatchStrategicMerge{patchList4},
|
||||||
expectedOut: []*Resource{},
|
expectedOut: []*Resource{testDeploymentNoItems},
|
||||||
expectedErr: false,
|
expectedErr: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -360,9 +390,9 @@ kind: List
|
|||||||
assert.Equal(t, len(test.expectedOut), len(rs))
|
assert.Equal(t, len(test.expectedOut), len(rs))
|
||||||
for i := range rs {
|
for i := range rs {
|
||||||
expYaml, err := test.expectedOut[i].AsYAML()
|
expYaml, err := test.expectedOut[i].AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
actYaml, err := rs[i].AsYAML()
|
actYaml, err := rs[i].AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expYaml, actYaml)
|
assert.Equal(t, expYaml, actYaml)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -634,7 +664,7 @@ data:
|
|||||||
assert.Equal(t, len(tc.exp.out), len(rs))
|
assert.Equal(t, len(tc.exp.out), len(rs))
|
||||||
for i := range rs {
|
for i := range rs {
|
||||||
actual, err := rs[i].String()
|
actual, err := rs[i].String()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(
|
assert.Equal(
|
||||||
t, strings.TrimSpace(tc.exp.out[i]), strings.TrimSpace(actual))
|
t, strings.TrimSpace(tc.exp.out[i]), strings.TrimSpace(actual))
|
||||||
}
|
}
|
||||||
@@ -721,7 +751,7 @@ metadata:
|
|||||||
t.Run(n, func(t *testing.T) {
|
t.Run(n, func(t *testing.T) {
|
||||||
nin, _ := kio.FromBytes(tc.input)
|
nin, _ := kio.FromBytes(tc.input)
|
||||||
res, err := factory.DropLocalNodes(nin)
|
res, err := factory.DropLocalNodes(nin)
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
if tc.expected == nil {
|
if tc.expected == nil {
|
||||||
assert.Equal(t, 0, len(res))
|
assert.Equal(t, 0, len(res))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -12,21 +12,45 @@ import (
|
|||||||
|
|
||||||
func TestIdSet_Empty(t *testing.T) {
|
func TestIdSet_Empty(t *testing.T) {
|
||||||
s := MakeIdSet([]*Resource{})
|
s := MakeIdSet([]*Resource{})
|
||||||
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Failed to create test deployment: %v", err)
|
||||||
|
}
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Failed to create test config: %v", err)
|
||||||
|
}
|
||||||
assert.Equal(t, 0, s.Size())
|
assert.Equal(t, 0, s.Size())
|
||||||
assert.False(t, s.Contains(testDeployment.CurId()))
|
assert.False(t, s.Contains(td.CurId()))
|
||||||
assert.False(t, s.Contains(testConfigMap.CurId()))
|
assert.False(t, s.Contains(tc.CurId()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIdSet_One(t *testing.T) {
|
func TestIdSet_One(t *testing.T) {
|
||||||
s := MakeIdSet([]*Resource{testDeployment})
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test deployment: %v", err)
|
||||||
|
}
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test config: %v", err)
|
||||||
|
}
|
||||||
|
s := MakeIdSet([]*Resource{td})
|
||||||
assert.Equal(t, 1, s.Size())
|
assert.Equal(t, 1, s.Size())
|
||||||
assert.True(t, s.Contains(testDeployment.CurId()))
|
assert.True(t, s.Contains(td.CurId()))
|
||||||
assert.False(t, s.Contains(testConfigMap.CurId()))
|
assert.False(t, s.Contains(tc.CurId()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIdSet_Two(t *testing.T) {
|
func TestIdSet_Two(t *testing.T) {
|
||||||
s := MakeIdSet([]*Resource{testDeployment, testConfigMap})
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test Deployment: %v", err)
|
||||||
|
}
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test Config: %v", err)
|
||||||
|
}
|
||||||
|
s := MakeIdSet([]*Resource{td, tc})
|
||||||
assert.Equal(t, 2, s.Size())
|
assert.Equal(t, 2, s.Size())
|
||||||
assert.True(t, s.Contains(testDeployment.CurId()))
|
assert.True(t, s.Contains(td.CurId()))
|
||||||
assert.True(t, s.Contains(testConfigMap.CurId()))
|
assert.True(t, s.Contains(tc.CurId()))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
. "sigs.k8s.io/kustomize/api/resource"
|
. "sigs.k8s.io/kustomize/api/resource"
|
||||||
kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
|
kyaml "sigs.k8s.io/kustomize/kyaml/yaml"
|
||||||
)
|
)
|
||||||
@@ -37,7 +38,7 @@ repo: https://github.com/kubernetes-sigs/kustomize
|
|||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
actual, err := test.in.Append(test.path).String()
|
actual, err := test.in.Append(test.path).String()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, test.expected, actual)
|
assert.Equal(t, test.expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +79,7 @@ repo: github.com/kubernetes-sigs/kustomize/examples/multibases/dev/
|
|||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
actual, err := test.in.String()
|
actual, err := test.in.String()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, test.expected, actual)
|
assert.Equal(t, test.expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -154,7 +155,7 @@ func TestTransformationsString(t *testing.T) {
|
|||||||
}
|
}
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
actual, err := test.in.String()
|
actual, err := test.in.String()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, test.expected, actual)
|
assert.Equal(t, test.expected, actual)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,12 +287,25 @@ func (r *Resource) getCsvAnnotation(name string) []string {
|
|||||||
return strings.Split(annotations[name], ",")
|
return strings.Split(annotations[name], ",")
|
||||||
}
|
}
|
||||||
|
|
||||||
// PrefixesSuffixesEquals is conceptually doing the same task
|
// PrefixesSuffixesEquals is conceptually doing the same task as
|
||||||
// as OutermostPrefixSuffix but performs a deeper comparison
|
// OutermostPrefixSuffix but performs a deeper comparison of the suffix and
|
||||||
// of the suffix and prefix slices.
|
// prefix slices.
|
||||||
func (r *Resource) PrefixesSuffixesEquals(o ResCtx) bool {
|
// The allowEmpty flag determines whether an empty prefix/suffix
|
||||||
return utils.SameEndingSubSlice(r.GetNamePrefixes(), o.GetNamePrefixes()) &&
|
// should be considered a match on anything.
|
||||||
utils.SameEndingSubSlice(r.GetNameSuffixes(), o.GetNameSuffixes())
|
// This is used when filtering, starting with a coarser pass allowing empty
|
||||||
|
// matches, before requiring exact matches if there are multiple
|
||||||
|
// remaining candidates.
|
||||||
|
func (r *Resource) PrefixesSuffixesEquals(o ResCtx, allowEmpty bool) bool {
|
||||||
|
if allowEmpty {
|
||||||
|
eitherPrefixEmpty := len(r.GetNamePrefixes()) == 0 || len(o.GetNamePrefixes()) == 0
|
||||||
|
eitherSuffixEmpty := len(r.GetNameSuffixes()) == 0 || len(o.GetNameSuffixes()) == 0
|
||||||
|
|
||||||
|
return (eitherPrefixEmpty || utils.SameEndingSubSlice(r.GetNamePrefixes(), o.GetNamePrefixes())) &&
|
||||||
|
(eitherSuffixEmpty || utils.SameEndingSubSlice(r.GetNameSuffixes(), o.GetNameSuffixes()))
|
||||||
|
} else {
|
||||||
|
return utils.SameEndingSubSlice(r.GetNamePrefixes(), o.GetNamePrefixes()) &&
|
||||||
|
utils.SameEndingSubSlice(r.GetNameSuffixes(), o.GetNameSuffixes())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveBuildAnnotations removes annotations created by the build process.
|
// RemoveBuildAnnotations removes annotations created by the build process.
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/api/internal/utils"
|
"sigs.k8s.io/kustomize/api/internal/utils"
|
||||||
"sigs.k8s.io/kustomize/api/provider"
|
"sigs.k8s.io/kustomize/api/provider"
|
||||||
. "sigs.k8s.io/kustomize/api/resource"
|
. "sigs.k8s.io/kustomize/api/resource"
|
||||||
@@ -19,27 +20,39 @@ import (
|
|||||||
|
|
||||||
var factory = provider.NewDefaultDepProvider().GetResourceFactory()
|
var factory = provider.NewDefaultDepProvider().GetResourceFactory()
|
||||||
|
|
||||||
var testConfigMap = factory.FromMap(
|
func createTestConfigMap() (*Resource, error) {
|
||||||
map[string]interface{}{
|
res, err := factory.FromMap(
|
||||||
"apiVersion": "v1",
|
map[string]interface{}{
|
||||||
"kind": "ConfigMap",
|
"apiVersion": "v1",
|
||||||
"metadata": map[string]interface{}{
|
"kind": "ConfigMap",
|
||||||
"name": "winnie",
|
"metadata": map[string]interface{}{
|
||||||
"namespace": "hundred-acre-wood",
|
"name": "winnie",
|
||||||
},
|
"namespace": "hundred-acre-wood",
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to create test config: %w", err)
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
//nolint:gosec
|
//nolint:gosec
|
||||||
const configMapAsString = `{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"winnie","namespace":"hundred-acre-wood"}}`
|
const configMapAsString = `{"apiVersion":"v1","kind":"ConfigMap","metadata":{"name":"winnie","namespace":"hundred-acre-wood"}}`
|
||||||
|
|
||||||
var testDeployment = factory.FromMap(
|
func createTestDeployment() (*Resource, error) {
|
||||||
map[string]interface{}{
|
res, err := factory.FromMap(
|
||||||
"apiVersion": "apps/v1",
|
map[string]interface{}{
|
||||||
"kind": "Deployment",
|
"apiVersion": "apps/v1",
|
||||||
"metadata": map[string]interface{}{
|
"kind": "Deployment",
|
||||||
"name": "pooh",
|
"metadata": map[string]interface{}{
|
||||||
},
|
"name": "pooh",
|
||||||
})
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to create Deployment: %w", err)
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
const deploymentAsString = `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"pooh"}}`
|
const deploymentAsString = `{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"pooh"}}`
|
||||||
|
|
||||||
@@ -49,9 +62,13 @@ kind: Deployment
|
|||||||
metadata:
|
metadata:
|
||||||
name: pooh
|
name: pooh
|
||||||
`
|
`
|
||||||
yaml, err := testDeployment.AsYAML()
|
td, err := createTestDeployment()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatalf("failed to create test deployment: %s", err)
|
||||||
|
}
|
||||||
|
yaml, err := td.AsYAML()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to get yaml: %s", err)
|
||||||
}
|
}
|
||||||
if string(yaml) != expected {
|
if string(yaml) != expected {
|
||||||
t.Fatalf("--- expected\n%s\n--- got\n%s\n", expected, string(yaml))
|
t.Fatalf("--- expected\n%s\n--- got\n%s\n", expected, string(yaml))
|
||||||
@@ -59,16 +76,24 @@ metadata:
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestResourceString(t *testing.T) {
|
func TestResourceString(t *testing.T) {
|
||||||
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test deployment: %v", err)
|
||||||
|
}
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test config: %v", err)
|
||||||
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
in *Resource
|
in *Resource
|
||||||
s string
|
s string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
in: testConfigMap,
|
in: tc,
|
||||||
s: configMapAsString,
|
s: configMapAsString,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: testDeployment,
|
in: td,
|
||||||
s: deploymentAsString,
|
s: deploymentAsString,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@@ -78,18 +103,26 @@ func TestResourceString(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestResourceId(t *testing.T) {
|
func TestResourceId(t *testing.T) {
|
||||||
|
td, err := createTestDeployment()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test deployment: %v", err)
|
||||||
|
}
|
||||||
|
tc, err := createTestConfigMap()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test config: %v", err)
|
||||||
|
}
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
in *Resource
|
in *Resource
|
||||||
id resid.ResId
|
id resid.ResId
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
in: testConfigMap,
|
in: tc,
|
||||||
id: resid.NewResIdWithNamespace(
|
id: resid.NewResIdWithNamespace(
|
||||||
resid.NewGvk("", "v1", "ConfigMap"),
|
resid.NewGvk("", "v1", "ConfigMap"),
|
||||||
"winnie", "hundred-acre-wood"),
|
"winnie", "hundred-acre-wood"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: testDeployment,
|
in: td,
|
||||||
id: resid.NewResId(
|
id: resid.NewResId(
|
||||||
resid.NewGvk("apps", "v1", "Deployment"), "pooh"),
|
resid.NewGvk("apps", "v1", "Deployment"), "pooh"),
|
||||||
},
|
},
|
||||||
@@ -102,7 +135,7 @@ func TestResourceId(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestDeepCopy(t *testing.T) {
|
func TestDeepCopy(t *testing.T) {
|
||||||
r := factory.FromMap(
|
r, err := factory.FromMap(
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"apiVersion": "apps/v1",
|
"apiVersion": "apps/v1",
|
||||||
"kind": "Deployment",
|
"kind": "Deployment",
|
||||||
@@ -110,6 +143,9 @@ func TestDeepCopy(t *testing.T) {
|
|||||||
"name": "pooh",
|
"name": "pooh",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("failed to create test config: %v", err)
|
||||||
|
}
|
||||||
r.AppendRefBy(resid.NewResId(resid.Gvk{Group: "somegroup", Kind: "MyKind"}, "random"))
|
r.AppendRefBy(resid.NewResId(resid.Gvk{Group: "somegroup", Kind: "MyKind"}, "random"))
|
||||||
|
|
||||||
var1 := types.Var{
|
var1 := types.Var{
|
||||||
@@ -156,7 +192,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
patch, err := factory.FromBytes([]byte(`
|
patch, err := factory.FromBytes([]byte(`
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -171,11 +207,11 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 777
|
- containerPort: 777
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch))
|
require.NoError(t, resource.ApplySmPatch(patch))
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: apps/v1
|
assert.Equal(t, `apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -218,7 +254,7 @@ spec:
|
|||||||
A: X
|
A: X
|
||||||
B: Y
|
B: Y
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
patch, err := factory.FromBytes([]byte(`
|
patch, err := factory.FromBytes([]byte(`
|
||||||
apiVersion: example.com/v1
|
apiVersion: example.com/v1
|
||||||
kind: Foo
|
kind: Foo
|
||||||
@@ -232,10 +268,10 @@ spec:
|
|||||||
baz:
|
baz:
|
||||||
hello: world
|
hello: world
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch))
|
require.NoError(t, resource.ApplySmPatch(patch))
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: example.com/v1
|
assert.Equal(t, `apiVersion: example.com/v1
|
||||||
kind: Foo
|
kind: Foo
|
||||||
metadata:
|
metadata:
|
||||||
@@ -259,7 +295,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
patch, err := factory.FromBytes([]byte(`
|
patch, err := factory.FromBytes([]byte(`
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -268,10 +304,10 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 999
|
numReplicas: 999
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch))
|
require.NoError(t, resource.ApplySmPatch(patch))
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -281,6 +317,43 @@ spec:
|
|||||||
`, string(bytes))
|
`, string(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// regression test for https://github.com/kubernetes-sigs/kustomize/issues/5031
|
||||||
|
func TestApplySmPatch_Idempotency(t *testing.T) {
|
||||||
|
// an arbitrary number of times to apply the patch
|
||||||
|
patchApplyCount := 4
|
||||||
|
resourceYaml := `apiVersion: v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
labels: null
|
||||||
|
name: my-deployment
|
||||||
|
`
|
||||||
|
resource, err := factory.FromBytes([]byte(resourceYaml))
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
noOpPatch, err := factory.FromBytes([]byte(`
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: my-deployment
|
||||||
|
`))
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
for i := 0; i < patchApplyCount; i++ {
|
||||||
|
require.NoError(t, resource.ApplySmPatch(noOpPatch))
|
||||||
|
|
||||||
|
bytes, err := resource.AsYAML()
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
require.Equal(
|
||||||
|
t,
|
||||||
|
resourceYaml,
|
||||||
|
string(bytes),
|
||||||
|
"resource should be unchanged after re-application of patch",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestApplySmPatchShouldOutputListItemsInCorrectOrder(t *testing.T) {
|
func TestApplySmPatchShouldOutputListItemsInCorrectOrder(t *testing.T) {
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
name string
|
name string
|
||||||
@@ -410,13 +483,13 @@ spec:
|
|||||||
- name: foo
|
- name: foo
|
||||||
- name: bar
|
- name: bar
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
patch, err := factory.FromBytes([]byte(tc.patch))
|
patch, err := factory.FromBytes([]byte(tc.patch))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch))
|
require.NoError(t, resource.ApplySmPatch(patch))
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, tc.expectedOutput, string(bytes))
|
assert.Equal(t, tc.expectedOutput, string(bytes))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -529,13 +602,13 @@ metadata:
|
|||||||
name: test
|
name: test
|
||||||
finalizers: ["foo", "bar"]
|
finalizers: ["foo", "bar"]
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
patch, err := factory.FromBytes([]byte(tc.patch))
|
patch, err := factory.FromBytes([]byte(tc.patch))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch))
|
require.NoError(t, resource.ApplySmPatch(patch))
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, tc.expectedOutput, string(bytes))
|
assert.Equal(t, tc.expectedOutput, string(bytes))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -566,7 +639,7 @@ data:
|
|||||||
}
|
}
|
||||||
resource.MergeDataMapFrom(patch)
|
resource.MergeDataMapFrom(patch)
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
data:
|
data:
|
||||||
fruit: pear
|
fruit: pear
|
||||||
@@ -612,19 +685,19 @@ spec:
|
|||||||
hello: world
|
hello: world
|
||||||
`
|
`
|
||||||
r1, err := factory.FromBytes([]byte(s1))
|
r1, err := factory.FromBytes([]byte(s1))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r2, err := factory.FromBytes([]byte(s2))
|
r2, err := factory.FromBytes([]byte(s2))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NoError(t, r1.ApplySmPatch(r2))
|
require.NoError(t, r1.ApplySmPatch(r2))
|
||||||
bytes, err := r1.AsYAML()
|
bytes, err := r1.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expected, string(bytes))
|
assert.Equal(t, expected, string(bytes))
|
||||||
|
|
||||||
r1, _ = factory.FromBytes([]byte(s1))
|
r1, _ = factory.FromBytes([]byte(s1))
|
||||||
r2, _ = factory.FromBytes([]byte(s2))
|
r2, _ = factory.FromBytes([]byte(s2))
|
||||||
assert.NoError(t, r2.ApplySmPatch(r1))
|
require.NoError(t, r2.ApplySmPatch(r1))
|
||||||
bytes, err = r2.AsYAML()
|
bytes, err = r2.AsYAML()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, expected, string(bytes))
|
assert.Equal(t, expected, string(bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -939,17 +1012,17 @@ spec:
|
|||||||
|
|
||||||
for name, test := range tests {
|
for name, test := range tests {
|
||||||
resource, err := factory.FromBytes([]byte(test.base))
|
resource, err := factory.FromBytes([]byte(test.base))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
for _, p := range test.patch {
|
for _, p := range test.patch {
|
||||||
patch, err := factory.FromBytes([]byte(p))
|
patch, err := factory.FromBytes([]byte(p))
|
||||||
assert.NoError(t, err, name)
|
require.NoError(t, err, name)
|
||||||
assert.NoError(t, resource.ApplySmPatch(patch), name)
|
require.NoError(t, resource.ApplySmPatch(patch), name)
|
||||||
}
|
}
|
||||||
bytes, err := resource.AsYAML()
|
bytes, err := resource.AsYAML()
|
||||||
if test.errorExpected {
|
if test.errorExpected {
|
||||||
assert.Error(t, err, name)
|
require.Error(t, err, name)
|
||||||
} else {
|
} else {
|
||||||
assert.NoError(t, err, name)
|
require.NoError(t, err, name)
|
||||||
assert.Equal(t, test.expected, string(bytes), name)
|
assert.Equal(t, test.expected, string(bytes), name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1349,7 +1422,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
gvk := r.GetGvk()
|
gvk := r.GetGvk()
|
||||||
expected := "apps"
|
expected := "apps"
|
||||||
@@ -1377,7 +1450,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r.SetGvk(resid.GvkFromString("knd.ver.grp"))
|
r.SetGvk(resid.GvkFromString("knd.ver.grp"))
|
||||||
gvk := r.GetGvk()
|
gvk := r.GetGvk()
|
||||||
if expected, actual := "grp", gvk.Group; expected != actual {
|
if expected, actual := "grp", gvk.Group; expected != actual {
|
||||||
@@ -1400,7 +1473,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
r.AppendRefBy(resid.FromString("knd1.ver1.gr1/name1.ns1"))
|
r.AppendRefBy(resid.FromString("knd1.ver1.gr1/name1.ns1"))
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -1438,13 +1511,13 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
origin := &Origin{
|
origin := &Origin{
|
||||||
Path: "deployment.yaml",
|
Path: "deployment.yaml",
|
||||||
Repo: "github.com/myrepo",
|
Repo: "github.com/myrepo",
|
||||||
Ref: "master",
|
Ref: "master",
|
||||||
}
|
}
|
||||||
assert.NoError(t, r.SetOrigin(origin))
|
require.NoError(t, r.SetOrigin(origin))
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1458,7 +1531,7 @@ spec:
|
|||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`, r.MustString())
|
`, r.MustString())
|
||||||
or, err := r.GetOrigin()
|
or, err := r.GetOrigin()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, origin, or)
|
assert.Equal(t, origin, or)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1471,7 +1544,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`))
|
`))
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
origin1 := &Origin{
|
origin1 := &Origin{
|
||||||
Repo: "github.com/myrepo",
|
Repo: "github.com/myrepo",
|
||||||
Ref: "master",
|
Ref: "master",
|
||||||
@@ -1500,7 +1573,7 @@ spec:
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
assert.NoError(t, r.AddTransformation(origin1))
|
require.NoError(t, r.AddTransformation(origin1))
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1518,7 +1591,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`, r.MustString())
|
`, r.MustString())
|
||||||
assert.NoError(t, r.AddTransformation(origin2))
|
require.NoError(t, r.AddTransformation(origin2))
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -1543,9 +1616,9 @@ spec:
|
|||||||
numReplicas: 1
|
numReplicas: 1
|
||||||
`, r.MustString())
|
`, r.MustString())
|
||||||
transformations, err := r.GetTransformations()
|
transformations, err := r.GetTransformations()
|
||||||
assert.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, Transformations{origin1, origin2}, transformations)
|
assert.Equal(t, Transformations{origin1, origin2}, transformations)
|
||||||
assert.NoError(t, r.ClearTransformations())
|
require.NoError(t, r.ClearTransformations())
|
||||||
assert.Equal(t, `apiVersion: v1
|
assert.Equal(t, `apiVersion: v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
|
|||||||
@@ -41,7 +41,11 @@ func NewSeededRmBuilderDefault(t *testing.T, m resmap.ResMap) *rmBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rm *rmBuilder) Add(m map[string]interface{}) *rmBuilder {
|
func (rm *rmBuilder) Add(m map[string]interface{}) *rmBuilder {
|
||||||
return rm.AddR(rm.rf.FromMap(m))
|
r, err := rm.rf.FromMap(m)
|
||||||
|
if err != nil {
|
||||||
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
|
}
|
||||||
|
return rm.AddR(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rm *rmBuilder) AddR(r *resource.Resource) *rmBuilder {
|
func (rm *rmBuilder) AddR(r *resource.Resource) *rmBuilder {
|
||||||
@@ -53,7 +57,11 @@ func (rm *rmBuilder) AddR(r *resource.Resource) *rmBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rm *rmBuilder) AddWithName(n string, m map[string]interface{}) *rmBuilder {
|
func (rm *rmBuilder) AddWithName(n string, m map[string]interface{}) *rmBuilder {
|
||||||
err := rm.m.Append(rm.rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m))
|
r, err := rm.rf.FromMapWithNamespaceAndName(resid.DefaultNamespace, n, m)
|
||||||
|
if err != nil {
|
||||||
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
|
}
|
||||||
|
err = rm.m.Append(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rm.t.Fatalf("test setup failure: %v", err)
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
}
|
}
|
||||||
@@ -61,7 +69,11 @@ func (rm *rmBuilder) AddWithName(n string, m map[string]interface{}) *rmBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rm *rmBuilder) AddWithNsAndName(ns string, n string, m map[string]interface{}) *rmBuilder {
|
func (rm *rmBuilder) AddWithNsAndName(ns string, n string, m map[string]interface{}) *rmBuilder {
|
||||||
err := rm.m.Append(rm.rf.FromMapWithNamespaceAndName(ns, n, m))
|
r, err := rm.rf.FromMapWithNamespaceAndName(ns, n, m)
|
||||||
|
if err != nil {
|
||||||
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
|
}
|
||||||
|
err = rm.m.Append(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rm.t.Fatalf("test setup failure: %v", err)
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
}
|
}
|
||||||
@@ -69,7 +81,7 @@ func (rm *rmBuilder) AddWithNsAndName(ns string, n string, m map[string]interfac
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (rm *rmBuilder) ReplaceResource(m map[string]interface{}) *rmBuilder {
|
func (rm *rmBuilder) ReplaceResource(m map[string]interface{}) *rmBuilder {
|
||||||
r := rm.rf.FromMap(m)
|
r, _ := rm.rf.FromMap(m)
|
||||||
_, err := rm.m.Replace(r)
|
_, err := rm.m.Replace(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
rm.t.Fatalf("test setup failure: %v", err)
|
rm.t.Fatalf("test setup failure: %v", err)
|
||||||
|
|||||||
@@ -96,6 +96,9 @@ type HelmChart struct {
|
|||||||
|
|
||||||
// SkipTests skips tests from templated output.
|
// SkipTests skips tests from templated output.
|
||||||
SkipTests bool `json:"skipTests,omitempty" yaml:"skipTests,omitempty"`
|
SkipTests bool `json:"skipTests,omitempty" yaml:"skipTests,omitempty"`
|
||||||
|
|
||||||
|
// debug enables debug output from the Helm chart inflator generator.
|
||||||
|
Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// HelmChartArgs contains arguments to helm.
|
// HelmChartArgs contains arguments to helm.
|
||||||
@@ -188,5 +191,8 @@ func (h HelmChart) AsHelmArgs(absChartHome string) []string {
|
|||||||
if h.SkipHooks {
|
if h.SkipHooks {
|
||||||
args = append(args, "--no-hooks")
|
args = append(args, "--no-hooks")
|
||||||
}
|
}
|
||||||
|
if h.Debug {
|
||||||
|
args = append(args, "--debug")
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,4 +60,21 @@ func TestAsHelmArgs(t *testing.T) {
|
|||||||
"-f", "values1", "-f", "values2",
|
"-f", "values1", "-f", "values2",
|
||||||
"--api-versions", "foo", "--api-versions", "bar"})
|
"--api-versions", "foo", "--api-versions", "bar"})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
t.Run("use helm-debug", func(t *testing.T) {
|
||||||
|
p := types.HelmChart{
|
||||||
|
Name: "chart-name",
|
||||||
|
Version: "1.0.0",
|
||||||
|
Repo: "https://helm.releases.hashicorp.com",
|
||||||
|
ValuesFile: "values",
|
||||||
|
AdditionalValuesFiles: []string{"values1", "values2"},
|
||||||
|
Debug: true,
|
||||||
|
}
|
||||||
|
require.Equal(t, p.AsHelmArgs("/home/charts"),
|
||||||
|
[]string{"template", "--generate-name", "/home/charts/chart-name",
|
||||||
|
"-f", "values",
|
||||||
|
"-f", "values1",
|
||||||
|
"-f", "values2",
|
||||||
|
"--debug"})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ const (
|
|||||||
MetadataNamespacePath = "metadata/namespace"
|
MetadataNamespacePath = "metadata/namespace"
|
||||||
MetadataNamespaceApiVersion = "v1"
|
MetadataNamespaceApiVersion = "v1"
|
||||||
MetadataNamePath = "metadata/name"
|
MetadataNamePath = "metadata/name"
|
||||||
|
NamespaceKind = "Namespace"
|
||||||
|
|
||||||
OriginAnnotations = "originAnnotations"
|
OriginAnnotations = "originAnnotations"
|
||||||
TransformerAnnotations = "transformerAnnotations"
|
TransformerAnnotations = "transformerAnnotations"
|
||||||
@@ -55,6 +56,7 @@ type Kustomization struct {
|
|||||||
// Namespace to add to all objects.
|
// Namespace to add to all objects.
|
||||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||||
|
|
||||||
|
// Deprecated: Use the Labels field instead, which provides a superset of the functionality of CommonLabels.
|
||||||
// CommonLabels to add to all objects and selectors.
|
// CommonLabels to add to all objects and selectors.
|
||||||
CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
|
CommonLabels map[string]string `json:"commonLabels,omitempty" yaml:"commonLabels,omitempty"`
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,12 @@ package types
|
|||||||
type Label struct {
|
type Label struct {
|
||||||
// Pairs contains the key-value pairs for labels to add
|
// Pairs contains the key-value pairs for labels to add
|
||||||
Pairs map[string]string `json:"pairs,omitempty" yaml:"pairs,omitempty"`
|
Pairs map[string]string `json:"pairs,omitempty" yaml:"pairs,omitempty"`
|
||||||
// IncludeSelectors inidicates should transformer include the
|
// IncludeSelectors indicates whether the transformer should include the
|
||||||
// fieldSpecs for selectors. Custom fieldSpecs specified by
|
// fieldSpecs for selectors. Custom fieldSpecs specified by
|
||||||
// FieldSpecs will be merged with builtin fieldSpecs if this
|
// FieldSpecs will be merged with builtin fieldSpecs if this
|
||||||
// is true.
|
// is true.
|
||||||
IncludeSelectors bool `json:"includeSelectors,omitempty" yaml:"includeSelectors,omitempty"`
|
IncludeSelectors bool `json:"includeSelectors,omitempty" yaml:"includeSelectors,omitempty"`
|
||||||
// IncludeTemplates inidicates should transformer include the
|
// IncludeTemplates indicates whether the transformer should include the
|
||||||
// spec/template/metadata fieldSpec. Custom fieldSpecs specified by
|
// spec/template/metadata fieldSpec. Custom fieldSpecs specified by
|
||||||
// FieldSpecs will be merged with spec/template/metadata fieldSpec if this
|
// FieldSpecs will be merged with spec/template/metadata fieldSpec if this
|
||||||
// is true. If IncludeSelectors is true, IncludeTemplates is not needed.
|
// is true. If IncludeSelectors is true, IncludeTemplates is not needed.
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ type HelmConfig struct {
|
|||||||
Command string
|
Command string
|
||||||
ApiVersions []string
|
ApiVersions []string
|
||||||
KubeVersion string
|
KubeVersion string
|
||||||
|
Debug bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// PluginConfig holds plugin configuration.
|
// PluginConfig holds plugin configuration.
|
||||||
@@ -27,7 +28,6 @@ type PluginConfig struct {
|
|||||||
|
|
||||||
func EnabledPluginConfig(b BuiltinPluginLoadingOptions) (pc *PluginConfig) {
|
func EnabledPluginConfig(b BuiltinPluginLoadingOptions) (pc *PluginConfig) {
|
||||||
pc = MakePluginConfig(PluginRestrictionsNone, b)
|
pc = MakePluginConfig(PluginRestrictionsNone, b)
|
||||||
pc.FnpLoadingOptions.EnableStar = true
|
|
||||||
pc.HelmConfig.Enabled = true
|
pc.HelmConfig.Enabled = true
|
||||||
// If this command is not on PATH, tests needing it should skip.
|
// If this command is not on PATH, tests needing it should skip.
|
||||||
pc.HelmConfig.Command = "helmV3"
|
pc.HelmConfig.Command = "helmV3"
|
||||||
|
|||||||
@@ -46,8 +46,6 @@ const (
|
|||||||
type FnPluginLoadingOptions struct {
|
type FnPluginLoadingOptions struct {
|
||||||
// Allow to run executables
|
// Allow to run executables
|
||||||
EnableExec bool
|
EnableExec bool
|
||||||
// Allow to run starlark
|
|
||||||
EnableStar bool
|
|
||||||
// Allow container access to network
|
// Allow container access to network
|
||||||
Network bool
|
Network bool
|
||||||
NetworkName string
|
NetworkName string
|
||||||
|
|||||||
@@ -1,29 +1,33 @@
|
|||||||
# Running Configuration Functions using kustomize CLI
|
# Running Configuration Functions using kustomize CLI
|
||||||
|
|
||||||
Configuration functions can be implemented using any toolchain and invoked using any
|
Configuration functions can be implemented using any toolchain and invoked using
|
||||||
container workflow orchestrator including Tekton, Cloud Build, or run directly using `docker run`.
|
any container workflow orchestrator including Tekton, Cloud Build, or run
|
||||||
|
directly using `docker run`.
|
||||||
|
|
||||||
Run `config help docs-fn-spec` to see the Configuration Functions Specification.
|
Run `config help docs-fn-spec` to see the Configuration Functions Specification.
|
||||||
|
|
||||||
`kustomize fn run` is an example orchestrator for invoking Configuration Functions. This
|
`kustomize fn run` is an example orchestrator for invoking Configuration
|
||||||
document describes how to implement and invoke an example function.
|
Functions. This document describes how to implement and invoke an example
|
||||||
|
function.
|
||||||
|
|
||||||
## Example Function Implementation
|
## Example Function Implementation
|
||||||
|
|
||||||
Following is an example for implementing an nginx abstraction using a configuration
|
Following is an example for implementing an nginx abstraction using a
|
||||||
function.
|
configuration function.
|
||||||
|
|
||||||
### `nginx-template.sh`
|
### `nginx-template.sh`
|
||||||
|
|
||||||
`nginx-template.sh` is a simple bash script which uses a _heredoc_ as a templating solution
|
`nginx-template.sh` is a simple bash script which uses a _heredoc_ as a
|
||||||
for generating Resources from the functionConfig input fields.
|
templating solution for generating Resources from the functionConfig input
|
||||||
|
fields.
|
||||||
|
|
||||||
The script wraps itself using `config run wrap -- $0` which will:
|
The script wraps itself using `config run wrap -- $0` which will:
|
||||||
|
|
||||||
1. Parse the `ResourceList.functionConfig` (provided to the container stdin) into env vars
|
1. Parse the `ResourceList.functionConfig` (provided to the container stdin)
|
||||||
|
into env vars
|
||||||
2. Merge the stdout into the original list of Resources
|
2. Merge the stdout into the original list of Resources
|
||||||
3. Defaults filenames for newly generated Resources (if they are not set as annotations)
|
3. Defaults filenames for newly generated Resources (if they are not set as
|
||||||
to `config/NAME_KIND.yaml`
|
annotations) to `config/NAME_KIND.yaml`
|
||||||
4. Format the output
|
4. Format the output
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -82,10 +86,11 @@ End-of-message
|
|||||||
|
|
||||||
### Dockerfile
|
### Dockerfile
|
||||||
|
|
||||||
`Dockerfile` installs `kustomize fn` and copies the script into the container image.
|
`Dockerfile` installs `kustomize fn` and copies the script into the container
|
||||||
|
image.
|
||||||
|
|
||||||
```
|
```
|
||||||
FROM golang:1.20-bullseye
|
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
|
||||||
RUN go get sigs.k8s.io/kustomize/cmd/config
|
RUN go get sigs.k8s.io/kustomize/cmd/config
|
||||||
RUN mv /go/bin/config /usr/bin/config
|
RUN mv /go/bin/config /usr/bin/config
|
||||||
COPY nginx-template.sh /usr/bin/nginx-template.sh
|
COPY nginx-template.sh /usr/bin/nginx-template.sh
|
||||||
@@ -94,7 +99,8 @@ CMD ["nginx-template.sh]
|
|||||||
|
|
||||||
## Example Function Usage
|
## Example Function Usage
|
||||||
|
|
||||||
Following is an example of running the `kustomize fn run` using the preceding API.
|
Following is an example of running the `kustomize fn run` using the preceding
|
||||||
|
API.
|
||||||
|
|
||||||
When run by `kustomize fn run`, functions are run in containers with the
|
When run by `kustomize fn run`, functions are run in containers with the
|
||||||
following environment:
|
following environment:
|
||||||
@@ -102,12 +108,14 @@ following environment:
|
|||||||
- Network: `none`
|
- Network: `none`
|
||||||
- User: `nobody`
|
- User: `nobody`
|
||||||
- Security Options: `no-new-privileges`
|
- Security Options: `no-new-privileges`
|
||||||
- Volumes: the volume containing the `functionConfig` yaml is mounted under `/local` as `ro`
|
- Volumes: the volume containing the `functionConfig` yaml is mounted under
|
||||||
|
`/local` as `ro`
|
||||||
|
|
||||||
### Input
|
### Input
|
||||||
|
|
||||||
`dir/nginx.yaml` contains a reference to the Function. The contents of `nginx.yaml`
|
`dir/nginx.yaml` contains a reference to the Function. The contents of
|
||||||
are passed to the Function through the `ResourceList.functionConfig` field.
|
`nginx.yaml` are passed to the Function through the
|
||||||
|
`ResourceList.functionConfig` field.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: example.com/v1beta1
|
apiVersion: example.com/v1beta1
|
||||||
@@ -123,9 +131,10 @@ spec:
|
|||||||
replicas: 5
|
replicas: 5
|
||||||
```
|
```
|
||||||
|
|
||||||
- `annotations[config.kubernetes.io/function].container.image`: the image to use for this API
|
- `annotations[config.kubernetes.io/function].container.image`: the image to use
|
||||||
- `annotations[config.kubernetes.io/local-config]`: mark this as not a Resource that should
|
for this API
|
||||||
be applied
|
- `annotations[config.kubernetes.io/local-config]`: mark this as not a Resource
|
||||||
|
that should be applied
|
||||||
|
|
||||||
### Output
|
### Output
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,33 @@
|
|||||||
module sigs.k8s.io/kustomize/cmd/config
|
module sigs.k8s.io/kustomize/cmd/config
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-errors/errors v1.4.2
|
github.com/go-errors/errors v1.4.2
|
||||||
github.com/spf13/cobra v1.7.0
|
github.com/spf13/cobra v1.8.0
|
||||||
github.com/stretchr/testify v1.8.1
|
github.com/stretchr/testify v1.9.0
|
||||||
gopkg.in/inf.v0 v0.9.1
|
gopkg.in/inf.v0 v0.9.1
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0
|
sigs.k8s.io/kustomize/kyaml v0.18.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/sergi/go-diff v1.1.0 // indirect
|
github.com/sergi/go-diff v1.2.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
|
||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
@@ -30,7 +30,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
|
|||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -39,38 +40,39 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
|
|||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 h1:+FNtrFTmVw0YZGpBGX56XDee331t6JAXeK2bcyhLOOc=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
@@ -82,10 +84,11 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0 h1:6J33uKSoATlKZH16unr2XOhDI+otoe2sR3M8PDzW3K0=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/kustomize/kyaml v0.16.0/go.mod h1:xOK/7i+vmE14N2FdFyugIshB8eF6ALpy7jI87Q2nRh4=
|
sigs.k8s.io/kustomize/kyaml v0.18.1 h1:WvBo56Wzw3fjS+7vBjN6TeivvpbW9GmRaWZ9CIVmt4E=
|
||||||
|
sigs.k8s.io/kustomize/kyaml v0.18.1/go.mod h1:C3L2BFVU1jgcddNBE1TxuVLgS46TjObMwW5FT9FcjYo=
|
||||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
|
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
|
||||||
"sigs.k8s.io/kustomize/kyaml/copyutil"
|
"sigs.k8s.io/kustomize/kyaml/copyutil"
|
||||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||||
@@ -615,7 +616,7 @@ spec:
|
|||||||
defer openapi.ResetOpenAPI()
|
defer openapi.ResetOpenAPI()
|
||||||
sourceDir := filepath.Join("test", "testdata", test.dataset)
|
sourceDir := filepath.Join("test", "testdata", test.dataset)
|
||||||
baseDir := t.TempDir()
|
baseDir := t.TempDir()
|
||||||
assert.NoError(t, copyutil.CopyDir(filesys.MakeFsOnDisk(), sourceDir, baseDir))
|
require.NoError(t, copyutil.CopyDir(filesys.MakeFsOnDisk(), sourceDir, baseDir))
|
||||||
runner := commands.GetCatRunner("")
|
runner := commands.GetCatRunner("")
|
||||||
actual := &bytes.Buffer{}
|
actual := &bytes.Buffer{}
|
||||||
runner.Command.SetOut(actual)
|
runner.Command.SetOut(actual)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
|
"sigs.k8s.io/kustomize/cmd/config/internal/commands"
|
||||||
"sigs.k8s.io/kustomize/kyaml/copyutil"
|
"sigs.k8s.io/kustomize/kyaml/copyutil"
|
||||||
"sigs.k8s.io/kustomize/kyaml/filesys"
|
"sigs.k8s.io/kustomize/kyaml/filesys"
|
||||||
@@ -118,7 +119,7 @@ Deployment: 1
|
|||||||
defer openapi.ResetOpenAPI()
|
defer openapi.ResetOpenAPI()
|
||||||
sourceDir := filepath.Join("test", "testdata", test.dataset)
|
sourceDir := filepath.Join("test", "testdata", test.dataset)
|
||||||
baseDir := t.TempDir()
|
baseDir := t.TempDir()
|
||||||
assert.NoError(t, copyutil.CopyDir(filesys.MakeFsOnDisk(), sourceDir, baseDir))
|
require.NoError(t, copyutil.CopyDir(filesys.MakeFsOnDisk(), sourceDir, baseDir))
|
||||||
runner := commands.GetCountRunner("")
|
runner := commands.GetCountRunner("")
|
||||||
actual := &bytes.Buffer{}
|
actual := &bytes.Buffer{}
|
||||||
runner.Command.SetOut(actual)
|
runner.Command.SetOut(actual)
|
||||||
|
|||||||
@@ -493,204 +493,6 @@ metadata:
|
|||||||
a-string-value: 'a'
|
a-string-value: 'a'
|
||||||
a-int-value: '2'
|
a-int-value: '2'
|
||||||
a-bool-value: 'true'
|
a-bool-value: 'true'
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: "starlark_function_config",
|
|
||||||
args: func(d string) []string { return []string{"--enable-star"} },
|
|
||||||
files: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"script.star": `
|
|
||||||
# set the foo annotation on each resource
|
|
||||||
def run(r, fc):
|
|
||||||
for resource in r:
|
|
||||||
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
|
||||||
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
|
||||||
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
|
||||||
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
|
||||||
`,
|
|
||||||
"config.yaml": `
|
|
||||||
apiVersion: example.com/v1alpha1
|
|
||||||
kind: Input
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
config.kubernetes.io/function: |
|
|
||||||
starlark:
|
|
||||||
path: script.star
|
|
||||||
name: fn
|
|
||||||
data:
|
|
||||||
boolValue: true
|
|
||||||
intValue: 2
|
|
||||||
stringValue: a
|
|
||||||
`,
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
expectedFiles: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"config.yaml": `
|
|
||||||
apiVersion: example.com/v1alpha1
|
|
||||||
kind: Input
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
config.kubernetes.io/function: |
|
|
||||||
starlark:
|
|
||||||
path: script.star
|
|
||||||
name: fn
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
data:
|
|
||||||
boolValue: true
|
|
||||||
intValue: 2
|
|
||||||
stringValue: a
|
|
||||||
`,
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: "starlark_function_path",
|
|
||||||
args: func(d string) []string {
|
|
||||||
return []string{
|
|
||||||
"--enable-star", "--star-path", "script.star",
|
|
||||||
"--", "stringValue=a", "intValue=2", "boolValue=true",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
files: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"script.star": `
|
|
||||||
# set the foo annotation on each resource
|
|
||||||
def run(r, fc):
|
|
||||||
for resource in r:
|
|
||||||
resource["metadata"]["annotations"]["a-string-value"] = fc["data"]["stringValue"]
|
|
||||||
resource["metadata"]["annotations"]["a-int-value"] = fc["data"]["intValue"]
|
|
||||||
resource["metadata"]["annotations"]["a-bool-value"] = fc["data"]["boolValue"]
|
|
||||||
run(ctx.resource_list["items"], ctx.resource_list["functionConfig"])
|
|
||||||
`,
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
expectedFiles: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: "starlark_function_url",
|
|
||||||
args: func(d string) []string {
|
|
||||||
return []string{
|
|
||||||
"--enable-star", "--star-url", "https://storage.googleapis.com/kustomize-starlark-functions/annotate.star",
|
|
||||||
"--star-name", "annotate",
|
|
||||||
"--", "stringValue=a", "intValue=2", "boolValue=true",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
files: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
expectedFiles: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: "starlark_function_url_config",
|
|
||||||
args: func(d string) []string {
|
|
||||||
return []string{"--enable-star"}
|
|
||||||
},
|
|
||||||
files: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"config.yaml": `
|
|
||||||
apiVersion: example.com/v1alpha1
|
|
||||||
kind: Input
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
config.kubernetes.io/function: |
|
|
||||||
starlark:
|
|
||||||
url: https://storage.googleapis.com/kustomize-starlark-functions/annotate.star
|
|
||||||
name: fn
|
|
||||||
data:
|
|
||||||
boolValue: true
|
|
||||||
intValue: 2
|
|
||||||
stringValue: a
|
|
||||||
`,
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
expectedFiles: func(d string) map[string]string {
|
|
||||||
return map[string]string{
|
|
||||||
"deployment.yaml": `
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: foo
|
|
||||||
annotations:
|
|
||||||
a-bool-value: true
|
|
||||||
a-int-value: 2
|
|
||||||
a-string-value: a
|
|
||||||
`,
|
`,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright 2019 The Kubernetes Authors.
|
# Copyright 2019 The Kubernetes Authors.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
FROM golang:1.20-bullseye
|
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,30 @@
|
|||||||
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainerconfig
|
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainerconfig
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-errors/errors v1.4.2 // indirect
|
github.com/go-errors/errors v1.4.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/spf13/cobra v1.7.0 // indirect
|
github.com/spf13/cobra v1.8.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -38,43 +43,49 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
|
|||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright 2019 The Kubernetes Authors.
|
# Copyright 2019 The Kubernetes Authors.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
FROM golang:1.20-bullseye
|
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,31 @@
|
|||||||
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainerenvgenerator
|
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainerenvgenerator
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-errors/errors v1.4.2 // indirect
|
github.com/go-errors/errors v1.4.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/spf13/cobra v1.7.0 // indirect
|
github.com/spf13/cobra v1.8.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -38,45 +43,49 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
|
|||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright 2019 The Kubernetes Authors.
|
# Copyright 2019 The Kubernetes Authors.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
FROM golang:1.20-bullseye
|
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,31 @@
|
|||||||
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainer-render-helm-chart
|
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainer-render-helm-chart
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-errors/errors v1.4.2 // indirect
|
github.com/go-errors/errors v1.4.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/spf13/cobra v1.7.0 // indirect
|
github.com/spf13/cobra v1.8.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -38,45 +43,49 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
|
|||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright 2019 The Kubernetes Authors.
|
# Copyright 2019 The Kubernetes Authors.
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
FROM golang:1.20-bullseye
|
FROM public.ecr.aws/docker/library/golang:1.22.7-bullseye
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /go/src/
|
WORKDIR /go/src/
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,31 @@
|
|||||||
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainersimplegenerator
|
module sigs.k8s.io/kustomize/cmd/config/internal/commands/e2e/e2econtainersimplegenerator
|
||||||
|
|
||||||
go 1.20
|
go 1.22.7
|
||||||
|
|
||||||
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
require sigs.k8s.io/kustomize/kyaml v0.14.2
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/go-errors/errors v1.4.2 // indirect
|
github.com/go-errors/errors v1.4.2 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.4 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/gnostic-models v0.6.8 // indirect
|
github.com/google/gnostic-models v0.6.8 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
|
||||||
github.com/google/gofuzz v1.2.0 // indirect
|
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
github.com/inconshreveable/mousetrap v1.1.0 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
|
||||||
github.com/spf13/cobra v1.7.0 // indirect
|
github.com/spf13/cobra v1.8.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xlab/treeprint v1.2.0 // indirect
|
github.com/xlab/treeprint v1.2.0 // indirect
|
||||||
golang.org/x/sys v0.13.0 // indirect
|
golang.org/x/sys v0.21.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.33.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 // indirect
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 // indirect
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
|
||||||
sigs.k8s.io/yaml v1.3.0 // indirect
|
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
replace sigs.k8s.io/kustomize/kyaml => ../../../../../../kyaml
|
||||||
|
|||||||
@@ -1,35 +1,40 @@
|
|||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
|
||||||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
|
||||||
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
|
||||||
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
|
||||||
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE=
|
||||||
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
|
||||||
|
github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
|
||||||
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||||
|
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||||
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
|
||||||
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
|
||||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -38,45 +43,49 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
|
|||||||
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0=
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
|
||||||
|
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
|
||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
|
||||||
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
|
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
|
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
|
||||||
|
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
|
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
|
||||||
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
|
||||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961 h1:pqRVJGQJz6oeZby8qmPKXYIBjyrcv7EHCe/33UkZMYA=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780=
|
||||||
k8s.io/kube-openapi v0.0.0-20230601164746-7562a1006961/go.mod h1:l8HTwL5fqnlns4jOveW1L75eo7R9KFHxiE0bsPGy428=
|
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
|
||||||
k8s.io/utils v0.0.0-20230505201702-9f6742963106/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||||
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
|
||||||
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
|
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
|
||||||
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
|
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||||
|
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user