Commit Graph

5900 Commits

Author SHA1 Message Date
Katrina Verey
7a773a3a48 Configure wrapcheck linter to recognize wrapping done by kyaml's errors package 2022-05-09 17:02:02 -04: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
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
Kubernetes Prow Robot
ec212711d4 Merge pull request #4577 from koba1t/fix/replacement_wildcard_and_create_option_error_message
fix error message using replacement wildcard and create option
2022-04-13 13:44:46 -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
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
Kubernetes Prow Robot
e5041bae6f Merge pull request #4576 from kubernetes-sigs/dependabot/github_actions/actions/setup-go-3
Bump actions/setup-go from 2 to 3
2022-04-11 10:14:06 -07:00
dependabot[bot]
0d600af35a Bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-11 01:05:22 +00:00
Kubernetes Prow Robot
0989b26098 Merge pull request #4571 from KnVerey/releaser_1.18
Install goreleaser into go 1.18 image for build
2022-04-07 14:11:23 -07: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
fe604fd3d1 Install goreleaser into go 1.18 image for build 2022-04-06 15:51:37 -04:00
Kubernetes Prow Robot
4fc02497ae Merge pull request #4564 from KnVerey/rework_ci
Make CI much more effective
2022-04-06 12:36:26 -07:00
Katrina Verey
e96c38e3ab Use verbose mode in all test runs 2022-04-05 15:56:32 -04:00
Katrina Verey
29104d6fa9 Ignore XML in license header script 2022-04-05 15:03:13 -04:00
Katrina Verey
df57e196d8 more makefile cleanup 2022-04-05 14:55:50 -04:00
Katrina Verey
f3c825f550 Make sure build targets all install into Go bin 2022-04-05 14:40:33 -04:00
Katrina Verey
03c94eabb7 Base makefile and root makefile target for functions/examples 2022-04-05 14:37:18 -04:00
Katrina Verey
c071cdaedd More makefile cleanup 2022-04-05 14:31:17 -04:00
Katrina Verey
f68a0c50d9 less redundancy in presubmit 2022-04-04 20:50:56 -04:00
Katrina Verey
db34e923c5 rever meaning of verify kustomize target 2022-04-04 20:40:07 -04:00
Katrina Verey
df80b29694 Test other modules on all platforms 2022-04-04 20:14:49 -04: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
af06ae6b69 add kustomize module to tests that run on master 2022-04-04 17:47:33 -04:00
Katrina Verey
46875b6ac4 More makefile cleanup 2022-04-04 16:46:41 -04:00
Katrina Verey
0fa010c7e7 Add missing boilerplate 2022-04-04 14:24:04 -04:00
Katrina Verey
3e652d6fea Add helpful error message to license check 2022-04-04 14:22:24 -04:00
Katrina Verey
f54014ce3b Add latest to go install commands 2022-04-04 14:10:29 -04:00
Katrina Verey
08924dc2f5 Fix root var and add sanity check 2022-04-04 14:03:29 -04:00
Kubernetes Prow Robot
49c0ed1326 Merge pull request #4563 from turrisxyz/naveensrinivasan/set-permissions
Add permissions to GitHub actions
2022-04-01 15:18:09 -07:00
Katrina Verey
7440f974b8 Lint needs goimports 2022-04-01 18:02:15 -04:00
Katrina Verey
ab9b89213b Delete duplicate copies of the license template 2022-04-01 17:56:06 -04:00
Katrina Verey
9fc012cc4e Do not change what the presubmit does yet 2022-04-01 17:55:52 -04:00
Katrina Verey
877d72b10b Run license check in CI 2022-04-01 17:42:59 -04:00
Naveen
c743f13d0d Add permissions to GitHub actions
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

Setting token permissions to read-only follows the principle of least privilege. This is important because attackers may use a compromised token with write access to push malicious code into the project.

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
2022-04-01 16:34:21 -05:00
Katrina Verey
0d32543ebd Makefiles for all modules 2022-04-01 17:31:34 -04:00
Kubernetes Prow Robot
28ee975948 Merge pull request #4543 from turrisxyz/dependabot
Included githubactions in the dependabot config
2022-04-01 09:44:46 -07:00
Katrina Verey
2a9adbeb1e Makefile cleanup 2022-03-31 19:02:19 -04:00
Kubernetes Prow Robot
672c751715 Merge pull request #4560 from KnVerey/go1.18-tools
Update and re-enable linters
2022-03-31 10:59:02 -07:00
Katrina Verey
d3a7b9008b Enable linting from specific rev in CI 2022-03-31 11:37:37 -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