Commit Graph

43 Commits

Author SHA1 Message Date
Karl Isenberg
43868688d5 Use require for Error and NoError
Assert keeps going after failure, but require immediately fails
the tests, making it easier to find the output related to the test
failure, rather than having to comb through a bunch of subsequent
assertion failures. For equality tests, we may or may not want to
continue, but for error checks we almost always want to immediately
fail the test. Exceptions can be changed as-needed.
2024-03-20 13:19:18 -07:00
Karl Isenberg
4dbc0d22e1 chore: Update to Go v1.21
- go mod tidy (all modules)
- go work sync
- Fixed plugin generation for Go 1.21
- Updated linting for Go 1.21
- Fixed minecraft example for Helm v3 pull download path
- Update dev docs to mention Go 1.21
- Regenerate plugins with Go 1.21
2024-03-15 11:47:44 -07:00
Kurnianto Trilaksono
a90c19d577 Edit commentaries and ensure pluginator logic does not create diff 2023-09-17 00:23:32 +07:00
koba1t
5b76aa9d2f update go 1.20 2023-06-06 22:39:06 +09:00
Katrina Verey
a612cd2b7e Fix pluginator incompatibility with nolint lines 2022-11-30 11:22:10 -05:00
Katrina Verey
7f9f6140ff Get rid of statik and fix failing tests 2022-11-23 20:34:38 -05:00
Kubernetes Prow Robot
78978723db Merge pull request #4840 from oscr/update-golangci-lint
Update golangci-lint version (1.49.0 -> 1.50.1) and enable linters: dupword and testableexamples
2022-11-17 10:36:29 -08:00
Katrina Verey
91a2c2b1a4 Update to Go 1.19 2022-11-17 12:57:17 -05:00
yugo kobayashi
3e6ede9645 fix_failed_lint_on_master 2022-11-04 07:12:46 +00:00
Oscar Utbult
e16b0f0dfc Update golangci-lint version (1.49.0 -> 1.50.1) and enable linters dupword and testableexamples 2022-10-31 19:31:56 +01:00
yugo kobayashi
401cf9579c update golangci-lint v1.49.0 2022-09-22 13:24:40 +00:00
Anna Song
f80cf9f433 Reinstate #4652 without url-related code
Remove code that changes remotes-loading code path, as mandated by #4756
2022-08-29 16:57:15 +00:00
Katrina Verey
f6b72077c8 Stop using deprecated ioutil functions 2022-08-10 18:22:46 -04:00
natasha41575
631f623d9c update statik 2022-07-29 14:30:18 -05:00
yugo kobayashi
3229c810cc restore require sigs.k8s.io/kustomize/* in go.mod 2022-07-08 16:58:01 +00:00
yugo kobayashi
c02d0e502a go work sync 2022-07-07 21:00:43 +00:00
yugo kobayashi
670cef4fd1 remove 'replace sigs.k8s.io/kustomize/*' and cleanup 2022-07-07 18:30:49 +00:00
yugo kobayashi
876ec8fa6b update to go 1.18 in github-action 2022-07-05 17:40:44 +00:00
koba1t
a6449aa03f try to fix e2econtainer test 2022-07-05 03:44:56 +09:00
koba1t
20a93fdd12 update functions/examples/template-go-nginx code and update go1.18 2022-06-30 03:05:00 +09:00
Anna Song
3fdf88d10e Allow tests to only run locally (#4664)
* Allow tests to only run locally

Allow tests that are flaky or currently unsupported on the server to run locally

* Address feedback
2022-06-08 10:04:23 -07:00
Natasha Sarkar
cf89eae804 openapi parsing performance improvement with protobuffer (#4568)
* update necessary dependencies

* update openapi test structure

* remove old swagger files and generate new ones

* use protobuffer to parse openapi for performance improvement
2022-04-18 11:10:43 -07:00
Eng Zer Jun
9452a031ba test: use T.TempDir to create temporary test directory (#4587)
* test: use `T.TempDir` to create temporary test directory

This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestInit_noargs` on Windows

--- FAIL: TestInit_noargs (0.01s)
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestInit_noargs3136084632\001: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestTreeCommandDefaultCurDir_files` on Windows

--- FAIL: TestTreeCommandDefaultCurDir_files (0.01s)
    testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestTreeCommandDefaultCurDir_files716679291\001: The process cannot access the file because it is being used by another process.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestCreateSetterCommand` on Windows

--- FAIL: TestCreateSetterCommand (13.27s)
    --- FAIL: TestCreateSetterCommand/add_replicas (1.45s)
        testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestCreateSetterCommandadd_replicas176222064\001\k8s-cli-487197005.yaml: The process cannot access the file because it is being used by another process.
    ...
    and all subtests
    ...

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestCreateSubstitutionCommand` on Windows

--- FAIL: TestCreateSubstitutionCommand (4.16s)
    --- FAIL: TestCreateSubstitutionCommand/substitution_replicas (1.30s)
        testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestCreateSubstitutionCommandsubstitution_replicas1352417113\001\k8s-cli-3183612276.yaml: The process cannot access the file because it is being used by another process.
    ...
    and all subtests
    ...

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestDeleteSetterCommand` on Windows

--- FAIL: TestDeleteSetterCommand (4.36s)
    --- FAIL: TestDeleteSetterCommand/delete_replicas (1.31s)
        testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestDeleteSetterCommanddelete_replicas3949811929\001\k8s-cli-957077271.yaml: The process cannot access the file because it is being used by another process.
    ...
    and all subtests
    ...

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestDeleteSubstitutionCommand` on Windows

--- FAIL: TestDeleteSubstitutionCommand (2.35s)
    --- FAIL: TestDeleteSubstitutionCommand/delete_only_subst_if_setter_has_same_name_-_long_ref (1.15s)
        testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestDeleteSubstitutionCommanddelete_only_subst_if_setter_has_same_name_-_long_ref2039728641\001\k8s-cli-1602861478.yaml: The process cannot access the file because it is being used by another process.
    ...
    and all subtests
    ...

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

* test: fix `TestSetCommand` on Windows

--- FAIL: TestSetCommand (13.76s)
    --- FAIL: TestSetCommand/set_replicas (1.13s)
        testing.go:1090: TempDir RemoveAll cleanup: remove C:\Users\RUNNER~1\AppData\Local\Temp\TestSetCommandset_replicas3781384539\001\k8s-cli-1030344459.yaml: The process cannot access the file because it is being used by another process.
    ...
    and all subtests
    ...

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-04-18 09:32:41 -07:00
Katrina Verey
0fa010c7e7 Add missing boilerplate 2022-04-04 14:24:04 -04:00
Katrina Verey
0d32543ebd Makefiles for all modules 2022-04-01 17:31:34 -04:00
Katrina Verey
b0d2e4bdcd Enable more linters for new code 2022-03-31 11:37:26 -04:00
Katrina Verey
71bf0d5d14 Update full linter list and enable some easily resolved new ones 2022-03-31 11:37:26 -04:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Yuwen Ma
a1c5d79d94 Move api/builtin to internal 2021-11-22 15:54:18 -08:00
natasha41575
c3c02887ec bump ResourceList from v1alpha1 to v1 2021-10-19 16:15:27 -07:00
Mikhail Mazurskiy
a3ed120efb Handle errors 2021-06-05 09:43:13 +10:00
monopole
c8dddac5b9 Move resid package from api to kyaml 2021-04-30 20:39:32 -07:00
monopole
aa5b4814d6 upgrade to helm 3.5.4 and imdario/mergo v0.3.12 2021-04-09 15:05:41 -07:00
monopole
6f6d41f17f Remove dead merge conflict code. 2021-03-17 06:35:30 -07:00
monopole
123a5d6e56 Remove the wrappy layer. 2021-03-15 15:59:06 -07:00
Katrina Verey
a7000dd9c6 Update unpinned pluginator to new framework 2021-03-03 08:27:19 -08:00
jregan
f66e5bb923 Extract conflict detection to it's own interface.
This PR
 - defines a patch conflict detector interface,
 - extracts implementations of the interface from the
   merginator code, making the merginator code
   independent of --enable_kyaml.
 - injects those implementations into kustomize
   as a function of --enable_kyaml.

So, instead of using different merginators to combine
resmaps, this pr allows the use of a single patch merge
code path that uses different conflict detectors.

So instead of debating how to merge, we're now only
considering whether to warn on conflict detection
in one transformer.

This PR is in service of #3304, eliminating seven
instances where --enable_kyaml was consulted.  These
were cases where conflict detection wasn't an issue
(but merging patches was).
2020-12-06 08:38:45 -08:00
Donny Xia
8f7bcb9b16 update Go version to 1.15 2020-11-25 12:41:20 -08:00
jregan
a5f3d5c823 Use DepProvider in tests to access kyaml impls. 2020-11-21 14:49:44 -08:00
Jeff Regan
849d5c4a8d Merge branch 'master' into krm-function-converter 2020-11-21 06:10:25 -08:00
Donny Xia
6cb339142d update module api version in wrapper 2020-11-20 16:28:38 -08:00
Donny Xia
2f4c35347e Get plugin config from data field 2020-11-19 13:11:47 -08:00
Donny Xia
2ae323bb26 move files into internal 2020-11-18 12:21:59 -08:00