Commit Graph

23 Commits

Author SHA1 Message Date
Patrick Ohly 348f12d905 remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".

Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
2024-12-02 14:43:58 +01:00
José Carlos Chávez 65a57a36aa chore: adds consistent vanity import to files and provides tooling for verifying and updating them. (#120642)
* chore: drops update vanity imports from script.

* chore: changes copyright year to 2024.

* chore: makes lint happy.

Kubernetes-commit: 6d6398ef9266abce3518a4c9a3d4e4d8feeffdc1
2024-02-08 15:58:16 +00:00
Sean Sullivan 348bd97228 OpenAPIResourcesGetter allows lazy-loading OpenAPI V2
Kubernetes-commit: 6614a29f470f802915d1467f5050dbca1f8bc562
2023-03-13 20:28:40 -07:00
Jefftree 6d49571c40 Update gnostic references
Kubernetes-commit: 2111e79f56acdfa6a8dab56780c52e3abc608758
2023-06-01 18:25:39 +00:00
Patrick Ohly 3dc5e5ffdf test: fix ginkgolinter issues
All of these issues were reported by https://github.com/nunnatsa/ginkgolinter.
Fixing these issues is useful (several expressions get simpler, using
framework.ExpectNoError is better because it has additional support for
failures) and a necessary step for enabling that linter in our golangci-lint
invocation.

Kubernetes-commit: 41f23f52d09689ede3540b8bd3ef7ec4f09410a1
2023-02-22 10:35:09 +01:00
Sean Sullivan fca10494ce Refactor validation files into openapi/validation
Kubernetes-commit: 84b226409aa656fbacdcd633807dd0b04d1fb34e
2023-01-09 15:59:41 -08:00
Sean Sullivan 072ad05626 Removes deprecated kubectl openapi column printing
Kubernetes-commit: 2f184814b89a4bfa482b8572e98e969681e2f64c
2023-01-10 15:30:04 -08:00
Arda Güçlü 89edfadfa3 Use OpenAPI to determine patch type in kubectl apply patching
Currently `kubectl apply` determines correct patch type for given
GVKs by trying to register schema and if it succeeds, it uses
strategic-merge-patch.

But OpenAPI endpoint already stores which patch types are supported
by GVKs. This PR checks OpenAPI endpoint to retrieve patch type,
if OpenAPI is enabled. If it is not enabled, patch type determination
will be done as conventional registration method.

Kubernetes-commit: cddbb0c56397448ac0489f0473a26601c1feece8
2022-06-08 13:12:16 +03:00
Dave Chen 1405be3f62 update ginkgo from v1 to v2 and gomega to 1.19.0
- update all the import statements
- run hack/pin-dependency.sh to change pinned dependency versions
- run hack/update-vendor.sh to update go.mod files and the vendor directory
- update the method signatures for custom reporters

Signed-off-by: Dave Chen <dave.chen@arm.com>

Kubernetes-commit: 857458cfa5b0083bc55736aaccbcf1dc796ba320
2022-03-29 14:12:12 +08:00
Dave Chen e0318c203f Remove `newlineReporter` custom report
The `newlineReporter` intends to print a new line after the test to
prevent the something print to the stdout and mess up the test result
while cause the tool like `go-junit-report` fail to parse the result.

But this is no longer needed based on following evidence.

- The issue that was first introduced in `go-junit-report` has already fixed in the version
referenced in `go.mod`.
- The `newlineReporter` report doesn't fix anything for `Ginkgo` v1 or V2 or `go test`, it just prints a
new line before the test summarization.

Signed-off-by: Dave Chen <dave.chen@arm.com>

Kubernetes-commit: 9953dde65dfaede9f1d481296053adc301ad9773
2022-06-01 13:09:47 +08:00
Dave Chen bdd48ac8f1 Fix the naming of the test suites
Signed-off-by: Dave Chen <dave.chen@arm.com>

Kubernetes-commit: 3c594d61567fc3cd5ef196a1419be957cdfaa5e1
2022-06-01 13:03:59 +08:00
Kevin Delgado 61f42e595f add server-side validation support to kubectl
Kubernetes-commit: fe3772890f650f9bcf020b43dc5a51fab0fa17f4
2022-03-09 14:52:32 +00:00
Jefftree ef358291b5 googleapis/gnostic -> google/gnostic
Kubernetes-commit: 8a1d5947ad34ba275192341baa4e5fef8e6c7f24
2022-03-15 20:36:21 -07:00
Davanum Srinivas 12c6b0404d Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
haoyun 343b5260f3 fix: combine assertion prevent npe
Signed-off-by: haoyun <yun.hao@daocloud.io>

Kubernetes-commit: 84a7329cf07b468ea47fd0617e6fdb9bdb174937
2021-12-01 16:37:24 +08:00
Gautier Delorme 579299d5e2 remove go-openapi/spec
Signed-off-by: Gautier Delorme <gautier.delorme@gmail.com>

Kubernetes-commit: 34b0fcef5fc47e3fcddf7f6ca1b3e6176b2a5323
2021-04-20 17:48:33 +02:00
Maciej Szulik 10f53d93f7 Fix kubectl openapi test to use apps/v1/Deployment
Kubernetes-commit: 7c194bb3e3daaadcf0bb785a16bffb3c1add274f
2021-03-01 19:24:15 +01:00
Julian V. Modesto 04f62ffb0b Cache the OpenAPI schema for server-side dry-run.
Currently, server-side dry-run fetches the OpenAPI schema for every
single object.

This change fetches the OpenAPI schema only once.

Kubernetes-commit: caa158610dfb53de3582ed6df0eb37359206fc66
2021-01-19 16:36:14 -05:00
Jordan Liggitt b0aa950238 github.com/googleapis/gnostic v0.4.1
Kubernetes-commit: 93c7b24562d80959f45c308e7412456a410b9b25
2020-03-31 17:18:56 -04:00
Julian V. Modesto a3f7877cd1 Support DryRun in cli-runtime REST Helper.
- Move TestSupportsDryRun to cli-runtime
- Move TestDryRunVerifier to cli-runtime
- Add OpenAPI schema for testdata to cli-runtime
- Use Helper.DryRun and DryRunVerifier for Apply
- Add WithOptions methods to Helper

Kubernetes-commit: 6bea0e469bcfe4967cbf2656a998d60e0b684747
2019-12-18 22:00:34 -05:00
Sean Sullivan 3ec9685c39 Rename test/data directory to testdata
Kubernetes-commit: 4ce97d6c48ae4735463f020430dd20539a03e8c5
2019-10-31 13:40:02 -07:00
Sean Sullivan b35b1f8c56 Move pkg/kubectl/cmd/util/openapi/OWNERS to staging
Kubernetes-commit: 8f0127503d06187588fb89a8751ea4f605dbd8b6
2019-07-30 14:09:18 -07:00
Sean Sullivan a18ed087c5 Move pkg/kubectl/cmd/util/openapi to staging
Kubernetes-commit: 7a64a66d61648ff0768837593d8066d828af262c
2019-07-25 21:49:49 -07:00