Commit Graph

274 Commits

Author SHA1 Message Date
Joe Betz 6f648c15a2 Add retry around create
Kubernetes-commit: a05db0dd22a68a9c443a9f01cc1b8f6397fd6a9f
2024-01-19 16:10:30 -05:00
liyuerich f709e954ab drop deprecated pointer package
Signed-off-by: liyuerich <yue.li@daocloud.io>

Kubernetes-commit: e490439262fad619d83c5647a42a5382cb9c787b
2023-09-15 21:03:36 +08:00
HirazawaUi f834404133 fix test store delete collection function failed
Kubernetes-commit: b12db6d9b55e02b232b716683a2d516e1788a9ce
2023-11-08 00:07:45 +08:00
Lukasz Szaszkiewicz f75c503352 storage/factory: extend the Create method by newList and resourcePrefix params
Kubernetes-commit: ccabc01093a1344ebb27c32c946e9da3b8e91fd2
2023-07-28 09:53:01 +02:00
Wojciech Tyczyński bf71493219 Simplify DeleteCollection
Kubernetes-commit: e08bd3bc263615f3a26bd17c66a3222e4b6ff7ec
2023-07-03 16:56:53 +02:00
Wojciech Tyczyński 6ab923fd4b Paginate within DeleteCollection call.
Kubernetes-commit: 732775ee7d1270b6056c371c4298a6b3380bec02
2023-02-09 20:59:18 +01:00
Antoine Pelisse d2d2fc8828 dryrun: Don't reuse current object for conversion
dry-run and non-dry-run are currently a little different since dry-run
was using the destination object to get the current status. That causes
a weird duplication bug with the HorizontalPodAutoscaler conversion
code. Addresses the bug by using an empty object for the current state
and keep the destination for its actual "out" purpose.

Kubernetes-commit: 20866b3f85ac50a094a4400469ebcac381cbc7e9
2023-06-02 13:37:34 -07:00
Daniel Smith 6abce7684c lavalamp is taking a long break
Kubernetes-commit: 1ffe3f467e8b8033312b7c68943d58125fd27663
2023-05-11 16:43:38 +00:00
Alexander Zielenski 29e89f54e2 move check for noop managed field timestamp updates
this check needs to go after any mutations. After the mutating admission chain, rest.BeforeUpdate (which is responsible for reverting updates to immutable timestamp fields, among other things.) is called in the store.Update function. Without moving this check, it will be possible for an object to be written to etcd with only a change to its managed fields timestamp.

Kubernetes-commit: 2b01f63b115e19e8ac9f8ee8e00dde65c5f40290
2023-03-22 11:18:50 -07:00
Aldo Culquicondor 62e2e0a1b7 Preserve UID/ResourceVersion in the BindingREST endpoint
Change-Id: If4023da10c455963a320fdb9fc2a73c099bea3db

Kubernetes-commit: 62889f416cb60f66b3f04810ef2475c425b8394a
2023-03-16 16:35:39 -04:00
Damien Grisonnet 77fa29c10e pkg/registry: rename pod logs metrics
The pod_logs subsystem was inadvertently made redundant in the following
kube-apiserver metrics:
- kube_apiserver_pod_logs_pods_logs_backend_tls_failure_total
- kube_apiserver_pod_logs_pods_logs_insecure_backend_total

To safely rename them, it is required to deprecate them in 1.27 whilst
introducing the new metrics replacing them.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>

Kubernetes-commit: 1efa1a65ee26c68de3f972f4e079338889a3e5e9
2022-12-14 23:40:21 +01:00
Lukasz Szaszkiewicz 175c211688 Add SendInitialEvents to storage ListOptions
Kubernetes-commit: e1537fc41b9eecb0e5026bfc72b27e4a07d771ba
2023-01-30 14:54:59 +01:00
Jordan Liggitt 8d0e8f8cb8 Partition watchers by namespace/name scope
Kubernetes-commit: 1c2fa0c7f791cbe28ee54d957d6f8a1120d91018
2023-02-05 18:46:19 -05:00
Wojciech Tyczyński 27cf1d8797 Minor refactor of DeleteCollection
Kubernetes-commit: e1aa521c141e14e53278b463233c0839238f642f
2023-02-09 21:14:17 +01:00
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