Commit Graph

1102 Commits

Author SHA1 Message Date
natasha41575
4a3bb926c5 Update kyaml to v0.13.7 2022-05-20 11:43:49 -07:00
Anna Song
a37572d193 Skip more flaky tests 2022-05-12 16:23:42 -07:00
Kubernetes Prow Robot
596519d3f2 Merge pull request #4631 from annasong20/localize-test
Add test directory for command localize
2022-05-10 11:13:43 -07:00
Kubernetes Prow Robot
d3d92157fa Merge pull request #4567 from mvgmb/master
Add support for remote OpenAPI schema
2022-05-10 11:01:43 -07:00
Anna Song
c83ebd9530 Add test directory for command localize
Create simple kustomization directory that `kustomize localize` can download as remote reference in test.
2022-05-10 10:58:33 -07:00
Anna Song
b8d2ff2afa Fix TODO comment syntax 2022-05-06 09:24:23 -07:00
Anna Song
7e0158e1e9 Skip flaky tests
Skip tests that behave reliably locally, but are flaky on macOS server.
2022-05-06 08:12:39 -07:00
Agustina Barbetta
5948f6aa63 [Address #3937] Add labels to template/metadata if includeTemplates is true (#4209)
* add labels in template/metadata by default

* update comment

* fix kustomization labels test

* Add spec/template/metadata/labels when includeTemplate is true

* remove unnecessary test changes

* add error wrap

* Revert "add error wrap"

This reverts commit 0a203df83edb90a400b35d5521487b984619e919.

* add error wrap at template fieldSpec merge
2022-05-05 11:24:22 -07:00
Anna Song
17b42a99f5 Skip ssh tests
Skip ssh tests and correct error msg that's different on server.
2022-05-05 09:26:44 -07:00
Anna Song
271f393218 Address feedback
Change asserts to, on fail, fail tests. Address feedback on previous commit. Enable ssh to check if server has ssh keys.
2022-05-04 18:54:12 -07:00
Anna Song
c0dc68d6e7 Add url tests
Write comprehensive suite of integration tests for remote resources, as specified by Issue #4588
2022-05-03 13:53:03 -07: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
Kubernetes Prow Robot
233b6adf7e Merge pull request #4605 from m-Bilal/fix-4559
Fix kustomize 4.5.3+ breaking remote resources (4559)
2022-05-02 13:34:31 -07:00
Mohd Bilal
66e4e1582b fix kustomize 4.5.3+ breaking remote resources (4559) 2022-04-23 06:25:24 +00:00
Mário Bezerra
d49e5aa5aa Add tests for remote OpenAPI schema 2022-04-20 00:03:22 -03:00
Mário Bezerra
94af647556 Add support for remote OpenAPI schema 2022-04-19 23:58:04 -03: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
Dipto Chakrabarty
a464ed0c59 add tagsuffix to take image tag suffix (#4364)
* add tagsuffix to take image tag suffix

* add comments to warn about specifications

* add test and error handle

* fix indent

* update comment

* fix merge errors and return updates

* update image update and fix example

* fix yamls formats

remove tabs in yamls

fix space in image name

tag error in name

* fix spacing issue

format of yaml

set example as above

* spacing of spec in testing templates

* change to switch case
2022-04-14 10:00:47 -07:00
koba1t
2f2e14e953 fix lint error to nolint:goerr113 2022-04-13 12:43:35 +09:00
koba1t
ed72bb02d4 fix lint error 2022-04-13 05:20:53 +09:00
koba1t
02e0b38bb0 fix lint error 2022-04-13 05:09:52 +09:00
koba1t
01ab069bd2 fix error message 2022-04-13 04:55:21 +09:00
koba1t
5e84de2a89 fix errror message using replacement wildcard and create option 2022-04-12 05:14:24 +09:00
Jennifer Cwagenberg
7888aef305 Raise error for external generators or transformers (#4565)
* Raise error if duplicate orgids for external transformers or external generators are configured

* Remove output of resources in error message

* Remove trailing newline
2022-04-06 15:46:25 -07:00
Katrina Verey
ea193328e3 Run all non plugin module builds 2022-04-04 19:23:08 -04:00
Katrina Verey
2d4bce5112 Do not run ineffective targets, do run all module tests 2022-04-04 18:13:00 -04: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
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
5c359bda28 Go 1.18 compatibility updates 2022-03-30 17:57:48 -04:00
natasha41575
b699204a9e unpin modules and test against latest release 2022-03-28 16:21:42 -07:00
Katrina Verey
7306402cca Update kyaml to v0.13.6 2022-03-28 17:07:02 -04:00
Garrett Thornburg
e97cecf9dc Add more name refs to PodTemplate for ConfigMap and Secret 2022-03-28 14:00:17 -06:00
natasha41575
c857ff8371 move to google/gnostic v0.5.7-v3refs 2022-03-25 15:05:18 -07:00
Katrina Verey
809182c6b6 Back to development mode; unpin the modules 2022-03-24 17:07:20 -04:00
natasha41575
784ae5efa3 Pin to kyaml v0.13.4 2022-03-24 12:58:51 -07: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
Kubernetes Prow Robot
2fe04496c2 Merge pull request #4485 from roopeshvs/master
Support for multiple replacements in a single file when replacing using path
2022-03-18 11:42:13 -07:00
Kubernetes Prow Robot
18f22f10a3 Merge pull request #4511 from NoicFank/master
fix broken link
2022-03-17 11:12:54 -07:00
Jim Ramsay
cb80659c22 Preserve scalar types when using the replacement filter
Erasing the scalar type tag leads to unfortunate circumstances, in that
the resulting yaml code is valid yaml, but will not meet the object
spec.

For example, using the replacement transformer to take a port number as
a string from a ConfigMap and set a Pod port would previously end up
with:
 - containerPort: "8080"
when the spec requires that this is not a string:
 - containerPort: 8080

Added unit tests for conversion to and from integers and booleans, plus
creation from string and creation from integer.

The creation behavior needs some refinement in a future PR.

Signed-off-by: Jim Ramsay <i.am@jimramsay.com>
2022-03-09 06:39:12 -05:00
Dingzhu Lurong
b1086ac49b fix broken link 2022-03-09 16:00:59 +08:00
roopeshvs
d1d578c392 support for multiple replacements in a single file 2022-03-04 12:46:45 +05:30
Mohd Bilal
3eae520532 test case added 2022-02-27 08:11:42 +00:00