Commit graph

191 commits

Author SHA1 Message Date
Maciej Szulik
afaa8c19fe
Update update-codegen.sh with sample-controller exception for openapi
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-01-29 16:06:16 +01:00
yongruilin
d764e81a66 Revert "Implement validation-gen lint for CI"
This reverts commit 252d584cb7.

Lint logic is implemented through golanci-lint&kube-api-linter
2025-10-22 18:02:06 +00:00
Benjamin Elder
7ed65b466d remove defunct comments about updating copy_output 2025-10-13 09:47:24 -07:00
Jordan Liggitt
6d8adfe402
Isolate generated ProtoMessage() methods in build-tagged files 2025-10-08 14:28:40 -04:00
Joe Betz
cfbe326e3a Enable openapi model name accessor generator
Signed-off-by: Joe Betz <jpbetz@google.com>
2025-09-10 15:52:58 -04:00
Sascha Grunert
ea02ce5b60
Update protobindings scripts to drop gogo paths
Cleanup the available scripts to remove unused code paths after all
gogo references have been migrated to native protobuf.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-09-01 09:35:20 +02:00
Sascha Grunert
fd2d2fd66f
Convert k8s.io/kubelet/pkg/apis/dra from gogo to protoc
Use standard protoc for the dra instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-08-29 09:40:51 +02:00
John-Paul Sassine
b7de71f9ce feat(kubelet): Add ResourceHealthStatus for DRA pods
This change introduces the ability for the Kubelet to monitor and report
the health of devices allocated via Dynamic Resource Allocation (DRA).
This addresses a key part of KEP-4680 by providing visibility into
device failures, which helps users and controllers diagnose pod failures.

The implementation includes:
- A new `v1alpha1.NodeHealth` gRPC service with a `WatchResources`
  stream that DRA plugins can optionally implement.
- A health information cache within the Kubelet's DRA manager to track
  the last known health of each device and handle plugin disconnections.
- An asynchronous update mechanism that triggers a pod sync when a
  device's health changes.
- A new `allocatedResourcesStatus` field in `v1.ContainerStatus` to
  expose the device health information to users via the Pod API.

Update vendor

KEP-4680: Fix lint, boilerplate, and codegen issues

Add another e2e test, add TODO for KEP4680 & update test infra helpers

Add Feature Gate e2e test

Fixing presubmits

Fix var names, feature gating, and nits

Fix DRA Health gRPC API according to review feedback
2025-07-24 23:23:18 +00:00
Sascha Grunert
c889ee17a2
Convert kubelet plugin manager from gogo to protoc
Use standard protoc for the kubelet plugin manager instead of gogo.

Part of https://github.com/kubernetes/kubernetes/issues/96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-23 16:55:05 +02:00
Sascha Grunert
3026020b44
Convert k8s.io/kubelet/pkg/apis/deviceplugin from gogo to protoc
Use standard protoc for the device plugin API instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-21 10:04:01 +02:00
Sascha Grunert
532d48fe6a
Convert k8s.io/kubelet/pkg/apis/podresources from gogo to protoc
Use standard protoc for the pod resources instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-17 14:56:44 +02:00
Sascha Grunert
8e6651520e
Convert k8s.io/kms/apis from gogo to protoc
Use standard protoc for the kms APIs instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-16 16:46:39 +02:00
Sascha Grunert
841886df76
Convert externaljwt from gogo to protoc
Use standard protoc for the `externaljwt` package instead of gogo.

Part of https://github.com/kubernetes/kubernetes/issues/96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-08 08:08:30 +02:00
Sascha Grunert
b464bbeb8f
Remove gogo-protobuf from CRI
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-07-04 08:55:57 +02:00
Benjamin Elder
d5bf33e7d7 update-codegen.sh: automatically install protoc 2025-04-24 22:54:09 -07:00
Benjamin Elder
8a2f367ec3 automatically install goimports when running update-codegen 2025-04-24 22:54:09 -07:00
Tim Hockin
252d584cb7
Implement validation-gen lint for CI
Results in errors like:

```
$ ./hack/verify-api-lint.sh
+++ [0317 09:00:04] Generating validation code for 69 targets
F0317 09:00:05.637556 1049736 targets.go:363] lint failed:
  type k8s.io/api/core/v1.PodAffinityTerm:
    field LabelSelector: conflicting tags: {+k8s:optional, +k8s:required}: fields cannot be both optional and required
    field Namespaces: conflicting tags: {+default, +k8s:required}: fields with default values are always optional
!!! [0317 09:00:05] Call tree:
!!! [0317 09:00:05]  1: hack/update-codegen.sh:1132 codegen::validation(...)
```
2025-03-21 08:20:04 -07:00
Aaron Prindle
cfcf7e93a3 chore(validation-gen): rename flag --extra-pkg -> --readonly-pkg in validation-gen 2025-03-11 19:17:48 +00:00
Joe Betz
6798e2d863 Add time to extra-pkgs for validation-gen 2025-03-08 14:21:49 -05:00
Joe Betz
9765fe4abb Add all extra_pkgs needed by main API types to validation-gen 2025-03-06 19:45:17 -05:00
Joe Betz
3210f46b5b Add validation-gen to codegen scripts
Add validation-gen to repository wide codegen scripts and introduce
`./hack/update-codegen.sh validation` as a quick way to run validation-gen.
2025-03-03 09:49:50 -05:00
Lionel Jouin
e9c47f8601 Add codegen::register to hack/update-codegen.sh
Co-authored-by: Joe Betz <jpbetz@google.com>
Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>
2025-02-23 19:51:12 +01:00
Harshal Neelkamal
6fdacf0411 Add plugin and key-cache for ExternalJWTSigner integration 2024-11-07 03:16:23 +00:00
Monis Khan
c2ae465355
Use protobuf for core clients
Signed-off-by: Monis Khan <mok@microsoft.com>
2024-10-23 10:56:34 -04:00
Patrick Ohly
91d7882e86 DRA: new API for 1.31
This is a complete revamp of the original API. Some of the key
differences:
- refocused on structured parameters and allocating devices
- support for constraints across devices
- support for allocating "all" or a fixed amount
  of similar devices in a single request
- no class for ResourceClaims, instead individual
  device requests are associated with a mandatory
  DeviceClass

For the sake of simplicity, optional basic types (ints, strings) where the null
value is the default are represented as values in the API types. This makes Go
code simpler because it doesn't have to check for nil (consumers) and values
can be set directly (producers). The effect is that in protobuf, these fields
always get encoded because `opt` only has an effect for pointers.

The roundtrip test data for v1.29.0 and v1.30.0 changes because of the new
"request" field. This is considered acceptable because the entire `claims`
field in the pod spec is still alpha.

The implementation is complete enough to bring up the apiserver.
Adapting other components follows.
2024-07-22 18:09:34 +02:00
Patrick Ohly
39bbcedbca dra api: add structured parameters
NodeResourceSlice will be used by kubelet to publish resource information on
behalf of DRA drivers on the node. NodeName and DriverName in
NodeResourceSlice must be immutable. This simplifies tracking the different
objects because what they are for cannot change after creation.

The new field in ResourceClass tells scheduler and autoscaler that they are
expected to handle allocation.

ResourceClaimParameters and ResourceClassParameters are new types for telling
in-tree components how to handle claims.
2024-03-07 16:15:31 +01:00
Tim Hockin
df7f5fca27
Don't embed plural exceptions in tools 2024-03-06 14:57:46 -08:00
Tim Hockin
00e09374b6
Make update-codegen avoid sub-workspaces 2024-02-29 22:10:39 -08:00
Tim Hockin
1a4450f6ff
Get rid of code-generator/cmd/openapi-gen
It's an exact duplicate of k8s.io/kube-openapi/cmd/openapi-gen.
2024-02-29 22:07:37 -08:00
Tim Hockin
8288c06b2b
Make hack scripts use go install and assume PATH
Now that they all call setup_env, we don't need find-binary (I think).
That was originally meant to hide the diff between docker and local
builds but all these tools do local builds anyway.
2024-02-29 22:07:32 -08:00
Tim Hockin
b68340e5b6
Get rid of gengo InputDirs flag 2024-02-29 22:07:23 -08:00
Tim Hockin
d0dd72b01e
Move OutputFileBase flag to each tool 2024-02-29 22:07:16 -08:00
Tim Hockin
26a1a13b80
Rename output-package -> output-pkg
To parallel "output-dir".
2024-02-29 22:07:15 -08:00
Tim Hockin
6a375b8f4c
Move the OutputBase flag to each tool
...and rename to --output-dir
2024-02-29 22:07:14 -08:00
Tim Hockin
0ff7dd1943
Rename gengo DefaultGen -> GolangGenerator 2024-02-29 22:07:12 -08:00
Tim Hockin
4320631265
codegen: Don't need to pass --logtostderr
All the tools already set it internally
2024-02-29 22:07:06 -08:00
Tim Hockin
19b37f046f
Rename update-generated-* dockerized
Now they don't start with "update" and confuse dumb scripts which try to
run all the updates.
2024-02-29 22:07:04 -08:00
Tim Hockin
94b709c0e2
codegen: Use single-dash for '-v' 2024-02-29 22:07:04 -08:00
Tim Hockin
3c2940f2ae
Kill off PRJ_SRC_PATH 2024-02-29 22:06:50 -08:00
Tim Hockin
530c4352fb
Rename new::setup_env back to setup_env 2024-02-29 22:06:44 -08:00
Tim Hockin
f772410082
Make code-gen subprojects work on gengo/v2 2024-02-29 22:06:38 -08:00
Tim Hockin
7506048d3f
Make update-codegen client work on gengo/v2 2024-02-29 22:06:36 -08:00
Tim Hockin
130a9f8426
Make update-codegen applyconfig work on gengo/v2 2024-02-29 22:06:34 -08:00
Tim Hockin
9c62235266
Make update-codegen informer work on gengo/v2 2024-02-29 22:06:32 -08:00
Tim Hockin
46665fa76a
Make update-codegen lister work on gengo/v2 2024-02-29 22:06:31 -08:00
Tim Hockin
1965f56f59
Make update-codegen openapi work on gengo/v2 2024-02-29 22:06:29 -08:00
Tim Hockin
5475797f43
Make update-codegen conversion work on gengo/v2 2024-02-29 22:06:28 -08:00
Tim Hockin
1e96f4e50a
Make update-codegen prerelease work on gengo/v2 2024-02-29 22:06:26 -08:00
Tim Hockin
b5b8c9d869
Make update-codegen swagger work on gengo/v2 2024-02-29 22:06:25 -08:00
Tim Hockin
8420278c7f
Make update-codegen defaulter work on gengo/v2 2024-02-29 22:06:24 -08:00