Commit Graph

260 Commits

Author SHA1 Message Date
Arda Güçlü d20862a68e Add singular name for the rest of types
Kubernetes-commit: 578ddde80e72a300fdb3798d68e550d2b4a61203
2022-11-03 10:18:45 +03:00
Arda Güçlü da3d6b945b Introduce singularNameProvider for core types
This introduces `singularNameProvider`. This provider will be used
by core types to have their singular names are defined in discovery
endpoint. Thanks to that, core resources singular name always have
higher precedence than CRDs shortcuts or singular names.

Kubernetes-commit: 0990ba1cc92449bbbd9b25a4391f1da834f8c5fd
2022-11-02 12:53:56 +03:00
Wojciech Tyczyński baa5a012e9 Lock ServerSideApply feature to true
Kubernetes-commit: 57c95fbfa12bc04456330d8b0b29f333106cf156
2022-09-27 11:13:00 +02:00
Antonio Ojea 852f0a02d4 Initialize Name (GenerateName) earlier in the Create process
Kubernetes-commit: af9d36f9310bc3c21791bf17470a667b690573b0
2022-08-26 13:20:43 +02:00
Antonio Ojea 89fb3670f4 test rest error generate name conflict
Kubernetes-commit: 20d190ec2ae90bc521e7342821a3a4301fe573af
2022-08-26 13:20:06 +02:00
Andy Goldstein ecf3a57374 watch cache: log GroupResource, not objectType
All CustomResources are treated as *unstructured.Unstructured, leading
the watch cache to log anything related to CRs as Unstructured. This
change uses the schema.GroupResource instead of object type for all type
related log messages in the watch cache, resulting in distinct output
for each CR type.

Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>

Kubernetes-commit: 397533a4c2df9639ff4422c907d06fae195a1835
2022-08-11 15:45:04 -04:00
cndoit18 902be89708 style: remove redundant judgment
Signed-off-by: cndoit18 <cndoit18@outlook.com>

Kubernetes-commit: ec43037d0f57fdfc2fdc4960fdb8a7e31ac79fae
2022-07-29 18:25:05 +08:00
Davanum Srinivas 7e94033a61 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

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

Kubernetes-commit: a9593d634c6a053848413e600dadbf974627515f
2022-07-19 20:54:13 -04:00
Tim Hockin 970b3ee9bb Initialize UID earlier in the Create process
Before:
  Create()
      BeginCreate()
      BeforeCreate()
          init UID <---------------------
          strategy code

After:
  Create()
      init UID <-------------------------
      BeginCreate()
      BeforeCreate()
          strategy code

This also wipes UID early (suggested by David) and asserts it is set in
BeforeCreate().

Kubernetes-commit: 5615de51f9e768dd01d7fe49a48e8db756bd8ac8
2022-06-17 15:32:25 -07:00
Steve Kuznetsov 80256820ce storage: move the APIObjectVersioner definition to storage
The means by which we extract and parse the version of an API object is
not specific to etcd3. In order to allow for a generic suite of tests
against any storage.Interface imlpementation, we need this logic to live
outside of the etcd3 package, or import cycles will exist.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 3939f3003e9605c06f65e64d1fc6f94b294f9d97
2022-05-11 07:44:21 -07:00
Wojciech Tyczyński d0a6d0fb72 Cleanup no-longer used storage cleanup method
Kubernetes-commit: 2dd44d6226efc6b72ae56b5fb81b5b2921cf3e16
2022-05-11 19:02:51 +02:00
Daniel Smith 088283fa36 Remove ClusterName
Kubernetes-commit: 331525670b772eb8956b7f5204078c51c00aaef3
2022-04-20 23:50:27 +00:00
Sanskar Jaiswal d1bd5277fb Update comment and declaration of `storage.GuaranteedUpdate` to be clearer.
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>

Kubernetes-commit: f8df26ae803103f82edbf1efe17b1b169801b256
2022-04-16 17:19:06 +05:30
Wojciech Tyczyński 2bba9591a3 Extend StandardStorage with Destroy to implement rbac storage destroy
Kubernetes-commit: f62c14a9cc24fa7fc5711b0aa74c7534c8d6793b
2022-04-19 11:18:39 +02:00
Wojciech Tyczyński 8010e8e7e3 Implement Destroy() method for all registries
Kubernetes-commit: 80060a502c3f86f00800fbeba7684a85f1ce5e17
2022-04-05 12:26:22 +02:00
Wojciech Tyczyński fbdcc3ee50 Cleanup rest storage resources on shutdown
Kubernetes-commit: 0527a0dd453c4b76259389ec8e8e6888c5e2a5ab
2022-04-05 11:00:06 +02:00
Jordan Liggitt 268935d657 Revert "remove unwanted values returned from dry-run"
This reverts commit 60c1d58d02c7374645c00281dda3fd656264e1c5.

Kubernetes-commit: adb76219198235bb069bb67e924455dceaaba7c4
2022-04-06 12:34:42 -04:00
Patrick Ohly ba3b8e9322 enhance and fix log calls
Some of these changes are cosmetic (repeatedly calling klog.V instead of
reusing the result), others address real issues:

- Logging a message only above a certain verbosity threshold without
  recording that verbosity level (if klog.V().Enabled() { klog.Info... }):
  this matters when using a logging backend which records the verbosity
  level.

- Passing a format string with parameters to a logging function that
  doesn't do string formatting.

All of these locations where found by the enhanced logcheck tool from
https://github.com/kubernetes/klog/pull/297.

In some cases it reports false positives, but those can be suppressed with
source code comments.

Kubernetes-commit: edffc700a43e610f641907290a5152ca593bad79
2022-02-16 12:17:47 +01:00
Daniel Smith 4861b9e3df review comments
Kubernetes-commit: 17e74b3936c341d2b6eed55570c0ffaabd52d3ad
2022-03-17 21:31:54 +00:00
Daniel Smith cbbb5800c3 find and replace
Kubernetes-commit: e405ae9ec8592bf028e351bab44de420908bac0d
2022-03-17 18:50:38 +00:00
Jordan Liggitt bacaca81ed set/validate object namespace before admission
Kubernetes-commit: 92422a73053129a88ea48e62a44410103a400376
2020-09-09 01:12:31 -04:00
Wojciech Tyczyński b028a2ea8d Unify merge GetToList and List storage methods to single GetList
Kubernetes-commit: f3d56369f71f5106eeec8300e77bd69b172733da
2022-02-10 10:15:29 +01:00
Wojciech Tyczyński 9f8f72fea9 Change storage.Interface to utilize recurisve parameter
Kubernetes-commit: 3016b3d8f868a3041c7cb86695de09d7ab27cf3b
2022-02-10 09:58:31 +01:00
Wojciech Tyczyński e6794552b0 Remove Selflink from convertors
Kubernetes-commit: 2169997dfea0a2f7ccf6911a745fc295793f70b4
2022-01-19 13:54:18 +01:00
Madhav Jivrajani 13301a9bd6 resttest: Modify TestContext to have namespace in context
Previously, if a request is clusterscoped, the context that
was returned has no namespace, ideally the context should
contain a metav1.NamespaceNone as the namespace even for
cluster scoped requests.

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>

Kubernetes-commit: 412626f4024b1acdd856c9047f97d387ee40f884
2022-02-10 12:54:15 +05:30
Wojciech Tyczyński 24beadcd3f DeleteCollection respects context cancellation
Kubernetes-commit: 90a77bc482cd72d27977f007e205a514ff408ff1
2022-02-04 15:51:23 +01:00
Joe Julian 7cac225c86 remove unwanted values returned from dry-run
Remove the uid and the resourceVersion from dry-run results per kep 576

https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/576-dry-run/README.md#generated-values

Kubernetes-commit: 60c1d58d02c7374645c00281dda3fd656264e1c5
2021-12-16 12:44:02 -08:00
Davanum Srinivas c56bc7b872 OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9682b7248fb69733c2a0ee53618856e87b067f16
2022-01-03 10:59:47 -05:00
Patrick Ohly ec795ae204 avoid klog Info calls without verbosity
In the following code pattern, the log message will get logged with v=0 in JSON
output although conceptually it has a higher verbosity:

   if klog.V(5).Enabled() {
       klog.Info("hello world")
   }

Having the actual verbosity in the JSON output is relevant, for example for
filtering out only the important info messages. The solution is to use
klog.V(5).Info or something similar.

Whether the outer if is necessary at all depends on how complex the parameters
are. The return value of klog.V can be captured in a variable and be used
multiple times to avoid the overhead for that function call and to avoid
repeating the verbosity level.

Kubernetes-commit: 9eaa2dc554e0c3d4485d4c916dfdbc2f517db2e0
2021-12-11 12:10:21 +01:00
Wojciech Tyczyński b4935b065f Slightly improve reliability of storage List tests.
Kubernetes-commit: 8ca6c5922b9a0bafa8c83617d6930b981430334e
2021-12-10 12:05:32 +01:00
Davanum Srinivas b840d63feb Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Davanum Srinivas 56a3a30ae1 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
Wojciech Tyczyński 71bfcaaea1 Simplify storage.Interface by merging Watch and WatchList functions.
Kubernetes-commit: 53653e9b0a7145c3b6e133c5639194ff79b3719d
2021-11-18 12:40:26 +01:00
Kevin Delgado 59227ac996 Server Side Field Validation
Implements server side field validation behind the
`ServerSideFieldValidation` feature gate. With the
feature enabled, any create/update/patch request
with the `fieldValidation` query param set to
"Strict" will error if the object in the request
body have unknown fields. A value of "Warn"
(also the default when the feautre is enabled)
will succeed the request with a warning.

When the feature is disabled (or the query param
has a value of "Ignore"), the request will succeed
as it previously had with no indications of any
unknown or duplicate fields.

Kubernetes-commit: e50e2bbc889eb274ad1463a54188a2805767bfde
2021-08-18 02:25:36 +00:00
Antonio Ojea 4662dacdd3 migrate nolint coments to golangci-lint
Kubernetes-commit: d126b1483840b5ea7c0891d3e7a693bd50fae7f8
2021-11-16 16:57:58 +01:00
Raffaele Di Fazio bd72ab7a82 improve wording for panic message
Kubernetes-commit: 8e9d28eede7a8c81d7a9111cba642246353e0d14
2021-11-05 18:43:12 +01:00
Wojciech Tyczyński 0f1abbd5e4 Fix delete collection error channel size
Kubernetes-commit: f609a8e0b525ee22b3ea1a850a3b0504627525ea
2021-10-25 08:07:21 +02:00
scott 5d7782c370 fix goroutine leak in the DeleteCollection
Kubernetes-commit: 53df1caeef608dd82d6c0d2433646f538dcd2b5a
2021-10-11 20:21:27 +08:00
Vince Prignano 2b1166c385 Object creation with generateName should return a proper error
Signed-off-by: Vince Prignano <vincepri@vmware.com>

Kubernetes-commit: 8a9d61278f6c2177309f58bf2655f2269e8f6afd
2021-08-31 18:04:59 -07:00
Mike Spreitzer b225af44fe Introduce storagebackend.ConfigForResource
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.

Kubernetes-commit: 85bcd243aa3c8769a5904a1aea44ce704f5e7174
2021-08-29 01:06:12 -04:00
Tim Hockin cf0112f87e REST: Document mutable inputs on Create()
If one doesn't DeepCopy() on the way into Create, we can end up writing
into the original object.  This is by design, and should not be a
problem EXCEPT for tests.  If a test compares the input to this function
with the result, but the input was mutated in-situ, it may hide errors,
resulting in tests that pass, but shouldn't.

Kubernetes-commit: 6dfae64d9bebb2c40680bbd6e8270f69839ab013
2021-08-13 11:54:00 -07:00
Tim Hockin 578388b70b Fix registry tests to look at result objects
Kubernetes-commit: 42c7e62180446910f41d3a064016c0d7cdebb407
2021-08-13 11:54:21 -07:00
Jordan Liggitt 29227fd4ee Avoid spurious calls to update/delete validation
Kubernetes-commit: 561ce035b5b7d577ddb5bb30657bc1f8b399e109
2021-08-05 17:21:40 -04:00
Abu Kashem feb4eefe1c apiserver: add callback to get notified of object count
Kubernetes-commit: 2c60feffbee690af4632d068158e640abe10f678
2021-07-14 16:44:34 -04:00
David Eads 526d12c09b prevent mutation of deletion options during delete collection
Kubernetes-commit: 649b87aaf85dbb6e8190bf7d16c5dc903b5ecedc
2021-03-10 15:41:03 -05:00
astraw99 532c5c3d69 fix delete nil pointer panic
Kubernetes-commit: af19d7f415d70a1de3d67a00921865ba2868b425
2021-06-26 18:06:20 +08:00
Shiming Zhang b76bf120f0 Allow delete with grace period 1s even if metadata period is negative
Kubernetes-commit: a8d4cfac933485b9b4e5e802e267723ce9d2b90f
2021-06-21 15:12:17 +08:00
lala123912 5c11e2a763 staging/src/k8s.io/apiserver/pkg/registry:migrate logs to structured logs
Kubernetes-commit: 8e7b5ff480b04342f78b6d321814f05e31abc4bb
2021-01-22 10:25:47 +08:00
Jordan Liggitt 862269412a Eliminate parallel and unnecessary embedded etcd instances
Kubernetes-commit: 068e4c55a8aef3c9f3b7eb4565fc3babfab186b5
2021-06-04 00:41:09 -04:00
Jordan Liggitt 584c18160b Fix closing of decorated watcher channel on timeout
Kubernetes-commit: bd2d63dd57e6011bfa3218e59e27fddaa295426b
2021-06-02 14:05:52 -04:00