Commit Graph

715 Commits

Author SHA1 Message Date
koba1t
e201dbb31a go work sync 2022-07-02 15:31:24 +09:00
koba1t
bc981fcbc3 merge upstream master 2022-07-02 15:18:26 +09:00
Anna Song
d1102fb726 Move demandDirectoryRoot into kyaml/filesys (#4677)
* Move demandDirectoryRoot into kyaml/filesys

* Make root directory platform-agnostic

Support windows root directory. Dogfood own error package.

* Use cleaner windows support implementation

* Address feedback

* Address feedback x2

* Re-apply go.sum changes to avoid CI errors
2022-06-30 11:12:07 -07:00
koba1t
20a93fdd12 update functions/examples/template-go-nginx code and update go1.18 2022-06-30 03:05:00 +09:00
koba1t
8c8a2125b7 update all go.mod to go1.18 2022-06-29 05:14:33 +09:00
koba1t
c583f4164c add support for go workspace mode 2022-06-28 23:42:56 +09:00
Davanum Srinivas
7e0fd02783 Switch github.com/xlab/treeprint to release tag : v1.1.0 (#4675)
* Switch github.com/xlab/treeprint to release tag : v1.1.0

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

* fix test to reflect changes in the dependency

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-06-10 14:33:46 -07:00
konrad945
ba7315ca76 Update testing_test.go 2022-05-12 19:38:15 +02:00
konrad945
ddf768195c Rename testing.go to testing_test.go 2022-05-12 16:43:27 +02:00
konrad945
b11cc3ae67 Fix comments 2022-05-12 16:42:28 +02:00
Kubernetes Prow Robot
c3b5d8fa19 Merge pull request #4629 from KnVerey/configure_templateparser
fn framework: bugfix for schema providers + configurable template extensions
2022-05-09 17:25:43 -07:00
Katrina Verey
7a773a3a48 Configure wrapcheck linter to recognize wrapping done by kyaml's errors package 2022-05-09 17:02:02 -04:00
annelausf
188e35fbfd Added code for fields with dots(.) in their names work as needed (#4591)
* Added code for fields with dots(.) in their names work as needed

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Fixed imports

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Removed comments

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Fix filter method

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Fixed failing tests

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Remove comments

Add co-author to PR.

Co-authored-by: sarjamil <sjamil@salesforce.com>

* Add co-author to PR.

Co-authored-by: sarjamil sjamil@salesforce.com

Co-authored-by: sarjamil <sjamil@salesforce.com>
2022-05-02 14:30:33 -07:00
Katrina Verey
2e230b4d4b Regression test and fix for APIs that satisfy ValidationSchemaProvider but not Validator 2022-04-22 17:19:49 -04:00
Katrina Verey
bcae65770a Configurable extensions for template parser 2022-04-21 18:28:13 -04:00
Natasha Sarkar
9d5491c2e2 fix containerized function mounts issue (#4489)
* fix containerized function mounts issue

* skip path test on windows

* move test out of temp dir

* update tests to deal with new working dir restrictions

* code review
2022-04-18 14:25:50 -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
koba1t
01ab069bd2 fix error message 2022-04-13 04:55:21 +09:00
koba1t
cdc4a5083b fix lint error 2022-04-12 12:53:58 +09:00
koba1t
5e84de2a89 fix errror message using replacement wildcard and create option 2022-04-12 05:14:24 +09:00
Katrina Verey
e96c38e3ab Use verbose mode in all test runs 2022-04-05 15:56:32 -04:00
Katrina Verey
ea193328e3 Run all non plugin module builds 2022-04-04 19:23:08 -04:00
Katrina Verey
2a9adbeb1e Makefile cleanup 2022-03-31 19:02:19 -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
1567b96ed3 Replace protobuf dep flagged by linter as deprecated 2022-03-31 11:37:26 -04:00
Katrina Verey
14947e449b Address new linter complaints 2022-03-31 11:37:26 -04:00
Katrina Verey
b368b347d1 Replace deprecated linters 2022-03-30 17:57:49 -04:00
Kubernetes Prow Robot
d2e59002ae Merge pull request #4538 from natasha41575/kubeopenapiupgrade
move to google/gnostic v0.5.7-v3refs
2022-03-25 15:37:58 -07:00
natasha41575
c857ff8371 move to google/gnostic v0.5.7-v3refs 2022-03-25 15:05:18 -07:00
Anna Song
497d2ee031 Added test for bug 4487: cannot parse keys with dots 2022-03-25 17:45:55 -04:00
Natasha Sarkar
e8640724a9 Merge pull request #4497 from m-Bilal/fix-3812
Fix 3812; Error message changed and check for MalformedYamlError
2022-03-24 09:55:44 -07: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
Rafael Leal
97de780feb Fix error during expansion of !!merge <<: anchor tags (#4383)
* WIP

* Fix merge corner cases

* Add test for explicit !!merge tag

* Fix tests

* Cleanup

* Cleanup

* Fix deanchoring lists

* Add test case for keeping comments

* Add MapEntrySetter and fix json marshalling after deanchoring

* Keep duplicated keys

* Move MergeTag definition to yaml alias

* Remove go-spew from api

* Add support for sequence nodes on merge tags

* Add docstring to MapEntrySetter.Key

* Add docstring to MapEntrySetter struct

* Add tests to MapEntrySetter

* Fix duplicate merge key

* Revert whitespace changes on forked go-yaml

* Remove AssocMapEntry function

* Refactoring merge order

* Return errors on VisitFields and PipeE

* Add tests for each non-conforming map merges
2022-03-23 09:36:17 -07:00
Mohd Bilal
e25db3df2e Test case updated 2022-02-27 09:11:00 +00:00
Mohd Bilal
bd05631887 Error type MalformedYamlError created. api.internal.target.kusttarget.accumulateResources checks for this new error type 2022-02-27 07:21:16 +00:00
Kubernetes Prow Robot
6950a0d246 Merge pull request #4467 from KnVerey/fn-cfg-openapi-validation
fn framework: Enable validation using openAPI schema for functionConfig
2022-02-24 10:32:31 -08:00
Katrina Verey
c90504a19d Enable validation using function config schema from KRMFunctionDefinition 2022-02-24 13:20:29 -05:00
Kubernetes Prow Robot
ff40460d3b Merge pull request #4424 from koba1t/feature/allow_setting_every_array_element_in_replacements
Allow setting every array element in replacements
2022-02-09 17:03:46 -08:00
koba1t
5ed96a34d7 rename IsMatchEveryIndex to IsWildcard 2022-02-10 05:13:29 +09:00
koba1t
22f9daa3ab replacements allow to replace multi values 2022-02-04 04:09:50 +09:00
Katrina Verey
a86723c3a3 Fix regression 4388 2022-02-02 12:36:03 -05:00
Katrina Verey
7bc51153d0 Add missing header 2022-02-01 18:06:27 -05:00
Katrina Verey
3c1e695f3f Update year in all the addlicense targets 2022-02-01 17:41:44 -05:00
koba1t
26b9af0379 Allow setting every array element in replacements 2022-01-27 06:17:23 +09:00
Mengqi Yu
816e2365bf Add benchmark test for parsing openapi in protobuf format 2022-01-25 12:10:25 -08:00
sdowell
3687250ca2 Add TrackableFilter interface (#4410)
* add kio filter interface

This interface is an extension of the Filter interface which can be used
for filters which are capable of tracking which fields they mutate.

* add TrackableSetter struct to filtersutil

This struct provides an abstraction to help Filters implement the
TrackableFilter interface

* implement TrackableFilter with annotations

This updates the annotations filter to implement the TrackableFilter
interface by reusing the TrackableSetter abstraction provided by
filtersutil.

This is done to provide a generic and consistent experience across the
filters

* implement TrackableFilter with labels

This updates the labels filter to implement the TrackableFilter
interface by reusing the TrackableSetter abstraction provided by
filtersutil.

This is done to provide a generic and consistent experience across the
filters
2022-01-24 11:05:32 -08:00
Kubernetes Prow Robot
77b1af2d91 Merge pull request #4352 from natasha41575/FilterErrors
prevent internal annotations from showing up in the errors thrown by filters
2021-12-29 13:45:22 -08:00
Sylvain Rabot
31b7cf9e0a Upgrade cobra for better zsh support
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2021-12-23 19:49:24 +01:00