Commit Graph

93 Commits

Author SHA1 Message Date
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
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
Shoshana Malfatto
7b0ec99d90 retain quotes in namespace transformer filter (#4421)
* check tag values for double quoting

* reuse setentry

* don't override single quotes in merge and fix cm generator immutable val

* get rid of comment

* starlark annotation tests

* don't commit test image changes

* set network to bool

* isSet bool

* updating e2e config tool

* leave createtag

* fn command failing unmarshal test

* fn command test

* don't set style in run-fs

* use setentry to set tag

* remove e2e test changes and make IsStringValue an RNode method
2022-03-23 14:25:19 -07:00
Natasha Sarkar
67a5f6d68f support krm spec v1 and legacy path, index, and id annotations 2021-09-17 17:10:10 -07:00
Katrina Verey
2e8a3b7c45 Use the forked go-yaml module 2021-06-28 15:29:32 -07:00
Gautier Delorme
a2871181fe remove go-openapi/spec,validate,strfmt from kyaml/
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>
2021-04-25 16:57:39 +02:00
Natasha Sarkar
4908654c09 if setter value ends in colon, treat it as a string 2020-12-21 11:54:30 -08:00
Phani Teja Marupaka
b6a4dd446a Refactor openAPI
Refactor global openapi
2020-11-16 23:03:56 -08:00
Phani Teja Marupaka
ec2cc2d421 Defer openAPI cleanup 2020-11-05 13:49:43 -08:00
Phani Teja Marupaka
bcaac6f8c1 Make isSet a parameter 2020-10-22 11:31:30 -07:00
Phani Teja Marupaka
e9ff26bb1b Make recurse logic public 2020-10-19 12:26:15 -07:00
Eyob Tefera
b1ea25e86a Add IsSet to SetterDefinition for kyaml release. 2020-10-17 00:46:30 +00:00
Phani Teja Marupaka
eba9edd7a6 Sync openAPI setter values with schema 2020-09-22 14:05:05 -07:00
Morten Torkildsen
d083c7f1d0 Determine namespaceability of resources from openapi schema 2020-09-12 15:01:42 -07:00
Phani Teja Marupaka
fc690f14a8 Format the output of cfg commands 2020-09-11 14:49:18 -07:00
Phani Teja Marupaka
0dc36a4f7c Annotate With Subpackages
Delete Setters And Subst With Subpkgs
2020-09-08 15:52:57 -07:00
Phani Teja Marupaka
8d74b8c3b5 Fix setters subpkgs friction 2020-09-02 23:06:26 -07:00
Phani Teja Marupaka
f432f4d75e Setters with subpackages 2020-09-01 10:54:08 -07:00
Phani Teja Marupaka
9d65dd0786 List setters in subpackages 2020-08-27 12:32:22 -07:00
Kubernetes Prow Robot
596c39b7bc Merge pull request #2855 from phanimarupaka/DeleteSubst
Delete substitution and fix delete setters
2020-08-19 12:27:23 -07:00
Phani Teja Marupaka
ca04c874f2 Delete substitution and fix delete setters 2020-08-18 22:24:50 -07:00
Phani Teja Marupaka
5d8722a786 Print message if subst doesn't match any field value 2020-08-16 15:54:34 -07:00
Morten Torkildsen
bcdbb1a282 Add test for adding setter with path inside a sequence 2020-08-12 20:04:39 -07:00
jregan
31c59bd7f2 Drop all calls to IsEmpty. 2020-08-09 10:47:06 -07:00
Morten Torkildsen
5c433ead5e Use k8s schema to determine formatting if no type on setter 2020-07-31 13:44:47 -07:00
Morten Torkildsen
feeaa994b7 Fix issue where the schema was not propagated correctly when walking yaml doc 2020-07-31 10:56:00 -07:00
Kubernetes Prow Robot
17f935452f Merge pull request #2778 from phanimarupaka/FixSetters
Fix command: Migrate v1 Setters to latest
2020-07-30 13:09:07 -07:00
Phani Teja Marupaka
6faff2d031 Fix V1 Setters and migrate to latest 2020-07-30 12:51:57 -07:00
Kubernetes Prow Robot
18a86bd7d6 Merge pull request #2784 from mortent/HandleIncorrectTypes
Handle some incorrect type values like 'int' and 'bool' in setters
2020-07-30 12:19:06 -07:00
Morten Torkildsen
6f63cf7238 SetterCreator accepts schema as a string rather than file path and validates schema 2020-07-28 22:53:21 -07:00
Morten Torkildsen
de0c8dedc4 Handle some incorrect type values like 'int' and 'bool' in setters 2020-07-28 13:49:07 -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
Jeff Regan
a70c6b3496 Tweak sequence treatment in fieldspecs 2020-07-22 09:23:47 -07:00
Phani Teja Marupaka
108195185f List and set setters in folders recursively 2020-07-20 00:50:04 -07:00
Morten Torkildsen
c419c1efc3 Allow setters/substitutions with . in the name 2020-07-11 10:41:27 -07:00
Phani Teja Marupaka
9567d7ef16 Remove count field, convert error to warning 2020-07-01 10:55:30 -07:00
jregan
436dada184 Upgrade to gopkg.in/yaml.v2 v2.3.0 2020-06-30 17:45:43 -07:00
Jeff Regan
83c5c4d1f1 Merge pull request #2661 from trodge/field-not-found-error
Error message for creating setter that matches no fields
2020-06-30 15:08:28 -07:00
Phani Teja Marupaka
0d90b769f1 Check if required setters are set 2020-06-30 13:21:17 -07:00
Thomas Rodgers
3a0dd72c88 added count for list setters 2020-06-29 09:52:18 -07:00
Thomas Rodgers
d4ed285fd1 added count for creating setters 2020-06-29 09:37:18 -07:00
Thomas Rodgers
4cae8cfe9b added error message 2020-06-29 09:37:18 -07:00
Phani Teja Marupaka
68ab3b87d9 Required setters for apply 2020-06-22 22:33:21 -07:00
Jijie Wei
be0f1a7fcb remove the uncessary conversion 2020-06-22 10:00:22 -07:00
Jijie Wei
99d2994b98 remove empty definition 2020-06-22 09:54:10 -07:00
Jijie Wei
25186e94af implement new visitor method 2020-06-18 13:49:54 -07:00
Jijie Wei
e4ba898e20 return subst name inerror message 2020-06-18 13:49:53 -07:00