Commit Graph

27 Commits

Author SHA1 Message Date
Katrina Verey
f6b72077c8 Stop using deprecated ioutil functions 2022-08-10 18:22:46 -04: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
ff4136b1a2 cmd/config linter updates 2022-03-31 11:37:26 -04:00
Natasha Sarkar
16dcc98cff deprecate some cfg commands 2021-07-19 14:31:20 -07:00
Phani Teja Marupaka
c3beadacd9 Check if value is provided 2021-03-23 15:40:35 -07:00
Phani Teja Marupaka
2278e01b7f Delete v1 setters code 2020-11-12 15:29:07 -08:00
Phani Teja Marupaka
c96fa7c347 Improve setter output message 2020-10-06 14:41:14 -07:00
Phani Teja Marupaka
fc690f14a8 Format the output of cfg commands 2020-09-11 14:49:18 -07:00
Phani Teja Marupaka
f432f4d75e Setters with subpackages 2020-09-01 10:54:08 -07:00
phani
d9fe98a289 Revert "List and set setters in folders recursively" 2020-07-22 13:51:42 -07:00
Jeff Regan
8b9829f222 Merge pull request #2738 from phanimarupaka/ListSettersRecursively
List and set setters in folders recursively
2020-07-22 13:14:13 -07:00
Phani Teja Marupaka
eb7beba8ad Fix V1 setters 2020-07-22 10:17:10 -07:00
Phani Teja Marupaka
108195185f List and set setters in folders recursively 2020-07-20 00:50:04 -07:00
Phani Teja Marupaka
68ab3b87d9 Required setters for apply 2020-06-22 22:33:21 -07:00
Phani Teja Marupaka
dbb16dcb6d Suggested changes 2020-06-16 15:11:25 -07:00
Phillip Wittrock
701c217791 Refactor kustomize config command structure
- Create cfg, fn, live parent commands
2020-06-06 08:50:41 -07:00
Phani Teja Marupaka
a43d43f2c4 Nested substitutions 2020-06-01 20:27:02 -07:00
Jijie Wei
572260c0f0 change args to use flags instead, so that values starting with hyphen can be correctly parsed. 2020-05-29 12:45:31 -07:00
Phani Teja Marupaka
98ba8b7491 Change to create setter 2020-05-26 13:39:23 -07:00
Phani Teja Marupaka
b3f5874978 Short hand notation for set 2020-05-21 11:15:16 -07:00
Phani Teja Marupaka
2320c10463 Validate list values against openAPI 2020-05-16 22:01:11 -07:00
Phani Teja Marupaka
7c731f0109 Validate substitutions against openAPI 2020-05-14 14:00:58 -07:00
Phani Teja Marupaka
eb7602fe19 Validate setters against openAPI 2020-05-13 21:34:28 -07:00
Phillip Wittrock
3c776b3435 fix setter clear set-by test 2020-02-26 20:25:05 -08:00
Phillip Wittrock
e004c31700 Make GetOpenAPIFile publicly settable 2020-02-21 08:09:48 -08:00
Phillip Wittrock
61cf3e6ec5 wire set 2.0 command 2020-02-19 14:25:38 -08:00