Commit Graph

82 Commits

Author SHA1 Message Date
Sascha Grunert dfb0aa2c4e 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>

Kubernetes-commit: fd2d2fd66ff2fb34dc38711ce1c8b04a1bccd893
2025-07-17 13:06:41 +02:00
Jordan Liggitt af8a887450 Add / update kubelet and DRA API owners
Kubernetes-commit: 6e9b60e3fd80403d4c92f56494daf78dea124138
2025-07-29 08:08:35 -04:00
John-Paul Sassine e6033dfbf2 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

Kubernetes-commit: b7de71f9ce74e99dde61ee138608df8edc5486bd
2025-06-17 20:49:12 +00:00
Sascha Grunert 3f57b9b21b 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>

Kubernetes-commit: c889ee17a2f86e0357348b72c52bd36c7dbe8682
2025-07-07 10:48:01 +02:00
Patrick Ohly db9675bce2 DRA kubelet: add v1 gRPC
The API is a direct copy of v1beta1, with v1beta1 replaced by v1.
The interoperability support is the same that was used for v1alpha4.
Adding it "reverts" the removal of the v1alpha4 support in
a57f15e0816ecbef48f91b318c070070e7cbb84e, except that now v1beta1 is the legacy
API which needs conversion. If kubelet and the plugin both support v1, no
conversion is needed.

Kubernetes-commit: f141907ddd89998e821eb1047885722c8ba8922b
2025-07-03 11:31:20 +02:00
Sascha Grunert 3c7be0577a 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>

Kubernetes-commit: 3026020b44a097a6f95a884e1e7f966c12675c0f
2025-07-17 13:47:44 +02:00
Sascha Grunert 27761cabf9 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>

Kubernetes-commit: 532d48fe6adebcd4be43979ff189140f2d047f30
2025-07-17 13:33:46 +02:00
Patrick Ohly b1b8e2064b DRA kubelet: remove v1alpha4
v1alpha4 was added in 1.31 and superseded by v1beta1 in 1.32. Since that
release, plugins are also required to advertise the supported gRPC services
during registration. In practice, all known DRA drivers use the helper code
from 1.32 or newer and thus don't need the legacy support.

Kubernetes-commit: a57f15e0816ecbef48f91b318c070070e7cbb84e
2025-06-27 10:03:04 +02:00
Patrick Ohly 4defd3ee14 DRA kubelet: API clarification
It's not okay to drop a claim from the response just because it encountered no
error. We want to be sure that a DRA driver really looked at the claim.

Kubernetes-commit: 005cef332da41990d08bee826262dd71fa74f522
2025-06-27 09:30:28 +02:00
Haowei Cai f5162a40ca API definition for PSI metrics
Kubernetes-commit: c7fc9d5f91aed676dcae15679eca42b646302377
2025-03-20 19:25:38 +00:00
Anish Ramasekar 32b1076ae4 Add service account token and annotation to v1 CredentialProviderRequest
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: dd7b9f6171bd94e18a6dfd25f10bf6388f3ea3bd
2024-10-25 12:59:51 -07:00
Patrick Ohly 74b7ed0014 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
Patrick Ohly b469d38af2 DRA kubelet: use unique protobuf package name
As mentioned in https://protobuf.dev/programming-guides/style, package names
"should be unique". For generated API pb files, Kubernetes uses
"k8s.io.api.<api group>.<version>". The same approach is now used for the
kubelet DRA v1beta1 API. This can be changed without a breaking change because
the API is still unreleased.

This avoids a conflict between the DevicePlugin and the DRA API when both get
used by kubelet:

    2024/11/10 12:51:40 proto: duplicate proto type registered: v1beta1.Device

The exact impact of that conflict is unknown but it seems better to
pro-actively avoid the problem.

Kubernetes-commit: 6c27e8dc8f789fd9daf11f6fc367adf586f727b5
2024-11-12 17:22:05 +01:00
Patrick Ohly 4109653856 DRA kubelet: separate beta and alpha gRPC APIs
Reusing types from the alpha in the beta made it possible to provide and use
both versions without conversion. The downside was that removal of the alpha
would have been harder, if not impossible. DRA drivers could continue to
use the alpha types and provided the beta interface automatically.

Now the two versions are completely separate gRPC APIs, although in practice
there are no differences besides the name. Support for the alpha API in kubelet
is provided via automatically generated conversion and manually written
interface wrappers.

Those are provided as part of the v1alpha4 package. The advantage of having all
of that in a central place is that it'll be easier to remove when no longer
needed.

Kubernetes-commit: 9261a182bb7693bc603a94e76af8bf98168ca16e
2024-11-07 07:38:10 +01:00
Patrick Ohly 7e9ffe6569 DRA kubelet: list supported gRPC services during registration
Listing supported gRPC services (e.g. drav1alpha3.Node, drav1beta1.DRAPlugin)
during registration enables the kubelet to determine in advance which methods
it can call.

Versioning by Kubernetes release makes less sense because it doesn't say
anything about which gRPC service is supported. New ones might get added and
obsolete ones removed. Some services might be optional.

In the past, this versioning support wasn't really used. At least one version
had to be provided and kubelet tried to use the plugin with the highest
version. This version comparison gets dropped. In the unlikely situation
that different plugins register under the same name, the most recent one is
used.

Because advertising gRPC services is a new convention, plugins only reporting
some version are treated as providing the old alpha gRPC service.

Kubernetes-commit: 2c23fe1b82467b0ed49ed8800c18334c4400132b
2024-11-02 21:45:25 +01:00
Patrick Ohly 5cbf982c86 DRA kubelet: rename gRPC server from Node to DRAPlugin in v1beta1
The version bump is an opportunity to pick a name that is a bit more
descriptive. It matches the "DevicePlugin" service name.

Kubernetes-commit: 437be1e651a6c5ff2259975c77af8575d2e66449
2024-11-02 20:34:04 +01:00
Patrick Ohly cc48d93402 DRA kubelet: add v1beta1 gRPC API
The v1beta1 API is identical to the previous v1alpha4, which erroneously was
still called "v1alpha3" in a few places, including the gRPC interface
definition itself.

The only reason for v1beta1 is to document the increased maturity of this API.

To simplify the transition, kubelet supports both v1alpha4 and v1beta1, picking
the more recent one automatically. All that DRA driver authors need to do to
implement v1beta1 is to update to the latest
k8s.io/dynamic-resource-allocation/kubeletplugin: it will automatically
register both API versions unless explicitly configured otherwise, which is
mostly just for testing.

DRA driver authors may replace their package import of v1alpha4 with v1beta1,
but they don't have to because the types in both packages are the same.

Kubernetes-commit: 7b3a9afca35cf60f4a5bc1d9cca5e25ff414d39d
2024-09-20 17:09:18 +02:00
Patrick Ohly 0a236149e9 DRA: add wg/device-management label automatically
This makes PRs show up automatically in the WG's project
board (https://github.com/orgs/kubernetes/projects/95/views/1).

Kubernetes-commit: 9d1b0654e0b9cd4cd3d99f33019a8b00fc65cbdf
2024-10-28 08:48:50 +01:00
Patrick Ohly f3e8a98486 DRA API: update some comments
Mentioning potential future API extensions help with understanding why the API
is defined the way it is when reading just the types.go. Those stand-alone
comments appear neither in the Go doc nor OpenAPI.

This corresponds to https://github.com/kubernetes/enhancements/pull/4808.

Kubernetes-commit: 148469d7ff00960bc13bd331009eec1db50122de
2024-08-27 16:06:23 +02:00
Patrick Ohly c4a7fd5cb7 DRA kubelet: adapt to v1alpha3 API
This adds the ability to select specific requests inside a claim for a
container.

NodePrepareResources is always called, even if the claim is not used by any
container. This could be useful for drivers where that call has some effect
other than injecting CDI device IDs into containers. It also ensures that
drivers can validate configs.

The pod resource API can no longer report a class for each claim because there
is no such 1:1 relationship anymore. Instead, that API reports claim,
API devices (with driver/pool/device as ID) and CDI device IDs. The kubelet
itself doesn't extract that information from the claim. Instead, it relies on
drivers to report this information when the claim gets prepared. This isolates
the kubelet from API changes.

Because of a faulty E2E test, kubelet was told to contact the wrong driver for
a claim. This was not visible in the kubelet log output. Now changes to the
claim info cache are getting logged. While at it, naming of variables and some
existing log output gets harmonized.

Co-authored-by: Oksana Baranova <oksana.baranova@intel.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>

Kubernetes-commit: 877829aeaa9b87d457bf1a3e59ae228e8aa1b1f0
2024-07-17 15:09:02 +02:00
Patrick Ohly 78e0369247 dra kubelet: bump gRPC API to v1alpha4
The previous changes are an API break, therefore we need a new version.

Kubernetes-commit: 7701a48bd6a4191745165e1b0f51b8e2518e51d6
2024-06-06 16:53:11 +02:00
Patrick Ohly 45d6a8ccfb DRA: read ResourceClaim in DRA drivers
This is the second and final step towards making kubelet independent of the
resource.k8s.io API versioning because it now doesn't need to copy structs
defined by that API from the driver to the API server.

Kubernetes-commit: 348f94ab55053ec9b4382de880406e27a730d8cd
2024-04-11 16:20:34 +02:00
Patrick Ohly 63f4c6d282 DRA: move ResourceSlice publishing into DRA drivers
This is a first step towards making kubelet independent of the resource.k8s.io
API versioning because it now doesn't need to copy structs defined by that API
from the driver to the API server. The next step is removing the other
direction (reading ResourceClaim status and passing the resource handle to
drivers).

The drivers must get deployed so that they have their own connection to the API
server. Securing at least the writes via a validating admission policy should
be possible.

As before, the kubelet removes all ResourceSlices for its node at startup, then
DRA drivers recreate them if (and only if) they start up again. This ensures
that there are no orphaned ResourceSlices when a driver gets removed while the
kubelet was down.

While at it, logging gets cleaned up and updated to use structured, contextual
logging as much as possible. gRPC requests and streams now use a shared,
per-process request ID and streams also get logged.

Kubernetes-commit: 616a01434756c4a818908a73b9256c9caa7d2c48
2024-04-11 16:20:34 +02:00
Mark Rossetti 97344d7894 Add support for memory pressure evictiong on Windows
Signed-off-by: Mark Rossetti <marosset@microsoft.com>

Kubernetes-commit: 0411a3d5651ed17f9a7dda4bb5dc0f97d154dc81
2024-01-10 19:28:56 -08:00
Patrick Ohly 43623d3554 DRA: remove support for v1alpha2 kubelet API
The v1alpha2 API is several releases old. No current drivers should still
depend on it.

Kubernetes-commit: 77341f7595048f3a82a171e4c79efc15b6cc2e70
2024-04-10 14:50:46 +02:00
Patrick Ohly cd24af6cc7 dra api: NodeResourceModel -> ResourceModel
When renaming NodeResourceSlice to ResourceSlice, the embedded
[Node]ResourceModel also should have been renamed.

Kubernetes-commit: a0add8d2c7578cd9f94fc302d6212f9f7d16175b
2024-03-14 14:08:17 +01:00
Patrick Ohly 65ef77b9ac dra kubelet: publish NodeResourceSlices
The information is received from the DRA driver plugin through a new gRPC
streaming interface. This is backwards compatible with old DRA driver kubelet
plugins, their gRPC server will return "not implemented" and that can be
handled by kubelet. Therefore no API break is needed.

However, DRA drivers need to be updated because the Go API changed. They can
return
    status.New(codes.Unimplemented, "no node resource support").Err()
if they don't support the new ListAndWatchResources method and
structured parameters.

The controller in kubelet then synchronizes this information from the driver
with NodeResourceSlice objects, creating, updating and deleting them as needed.

Kubernetes-commit: d59676a54531b6e135c0fbbe6b51c530f1150653
2024-02-26 12:53:04 +01:00
Patrick Ohly 93ffcc7bd8 kubelet: support structured parameters for preparing resources
If the resource handle has data from a structured parameter model, then we need
to pass that to the DRA driver kubelet plugin. Because Kubernetes uses
gogo/protobuf, we cannot use "optional" for that new optional field and have to
resort to "repeated" with a single repetition if present.

This is a new, backwards-compatible field.

That extending the resource.k8s.io changes the checksum of a kubelet checkpoint
is unfortunate. Updating the test cases is a stop-gap measure, the actual
solution will have to be something else before beta.

Kubernetes-commit: 6f1ddfcd2e36c76b4e28dbb0ea355441cc4caeb2
2024-02-20 18:17:51 +01:00
Alexey Fomenko 34741a1768 Fix typos in interface comments
Kubernetes-commit: 080fe8346da3182778830c25f79ee5dd2cc9c589
2023-10-30 16:36:43 +02:00
Kevin Hannon 2f96b49fbb add container filesystem to CRI api
Co-authored-by: Mike Brown <brownwm@us.ibm.com>

Kubernetes-commit: 8ae0d390d77e5f95b217254d18f64509cafaba36
2023-09-27 15:21:12 -04:00
Itamar Holder 9b6eb9c3a9 Add SwapStats to NodeStats, PodStats and ContainerStats
Signed-off-by: Itamar Holder <iholder@redhat.com>

Kubernetes-commit: a05d200ac8961ec29c8eebab46ca1fa249061a2f
2023-06-27 12:43:02 +03:00
Evan Lezar 9afe88e41b Add CDI devices to device plugin API
This change adds CDI device IDs to the ContainerAllocateResponse in the
device plugin API. This allows a device plugin to specify CDI devices
by their unique fully-qualified CDI device names using the related field
in the CRI specification.

Signed-off-by: Evan Lezar <elezar@nvidia.com>

Kubernetes-commit: b57c7e2fe4bb466ff1614aa9df7cc164e90b24b6
2023-05-16 15:12:32 +02:00
Patrick Ohly 1bbb334b4a kubelet: support batched prepare/unprepare in v1alpha3 DRA plugin API
Combining all prepare/unprepare operations for a pod enables plugins to
optimize the execution. Plugins can continue to use the v1beta2 API for now,
but should switch. The new API is designed so that plugins which want to work
on each claim one-by-one can do so and then report errors for each claim
separately, i.e. partial success is supported.

Kubernetes-commit: d743c50bb9e663809e0129ee058fabdcf59d3d27
2023-07-01 13:37:30 +02:00
Kevin Klues 704590723f Update kubeletplugin API for DynamicResourceAllocation to v1alpha2
This PR makes the NodePrepareResources() and NodeUnprepareResource()
calls of the kubeletplugin API for DynamicResourceAllocation
symmetrical. It wasn't clear how one would use the set of CDIDevices
passed back in the NodeUnprepareResource() of the v1alpha1 API, and the
new API now passes back the full ResourceHandle that was originally
passed to the Prepare() call. Passing the ResourceHandle is strictly
more informative and a plugin could always (re)derive the set of
CDIDevice from it.

This is a breaking change, but this release is scheduled to break
multiple APIs for DynamicResourceAllocation, so it makes sense to do
this now instead of later.

Signed-off-by: Kevin Klues <kklues@nvidia.com>

Kubernetes-commit: 579295e727a12deadad9e084ff8efd2708707091
2023-03-13 21:38:56 +00:00
Moshe Levi 0ce2bcfd40 kubelet podresources: extend List to support Dynamic Resources and implement Get API
Signed-off-by: Moshe Levi <moshele@nvidia.com>

Kubernetes-commit: 2a568bcfc821edd46e43cd072ba2a23456c9605e
2023-03-14 01:34:54 +02:00
Tim Hockin 852ac9b509 Set proto go_package: kubelet plugin register API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: bc1103e45fc82682b62c02d1fcd65a46cea3f9d6
2023-01-14 10:37:06 -08:00
Tim Hockin 558a8ec0e0 Set proto go_package: kubelet deviceplugin API
This exposes that the hand-written code used the wrong package name.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: 22ddeb02c1e7245ad3e8ae6835f2bd9ac10c3497
2023-01-14 10:27:13 -08:00
Tim Hockin d0ffd0e221 Set proto go_package: kubelet dynamic resource API
This package was specifying the option, but wrongly.

This also creates some diff to the *.pb.go files to note that in the
"options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: e4e26a7f0c30c669fa23186cbe5d2e41a6dc5b45
2023-01-14 10:30:08 -08:00
Tim Hockin 189da6f245 Set proto go_package: podresources API
This creates some diff to the *.pb.go files to note that
in the "options".

You can dump the gzipped blob with the following program (thanks
StackOverflow!):

```go
package main

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"os"

	"io/ioutil"

	proto "github.com/golang/protobuf/proto"
	dpb "github.com/golang/protobuf/protoc-gen-go/descriptor"
)

func main() {
	m := map[string][]byte{
		"before": blobv1,
		"after": blobv2,
	}
	arg := os.Args[1]
	dump(m[arg])
}

func dump(bytes []byte) {
	fd, err := decodeFileDesc(bytes)
	if err != nil {
		panic(err)
	}
	b, err := json.MarshalIndent(fd, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}

// decompress does gzip decompression.
func decompress(b []byte) ([]byte, error) {
	r, err := gzip.NewReader(bytes.NewReader(b))
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	out, err := ioutil.ReadAll(r)
	if err != nil {
		return nil, fmt.Errorf("bad gzipped descriptor: %v", err)
	}
	return out, nil
}

func decodeFileDesc(enc []byte) (*dpb.FileDescriptorProto, error) {
	raw, err := decompress(enc)
	if err != nil {
		return nil, fmt.Errorf("failed to decompress enc: %v", err)
	}

	fd := new(dpb.FileDescriptorProto)
	if err := proto.Unmarshal(raw, fd); err != nil {
		return nil, fmt.Errorf("bad descriptor: %v", err)
	}
	return fd, nil
}
```

Kubernetes-commit: a2603fdb81ab2160ec80f2063a258d18854e80e3
2023-01-14 10:22:56 -08:00
Tim Hockin 62e4faf81a Call update-proto-bindings from update-codegen
One script to bring them all ...

Kubernetes-commit: 4dae505d531e149881788dc36148602967419c75
2023-01-05 15:41:51 -08:00
Tim Hockin 16286abe1c Merge 5 fragile proto-bindings scripts into 1
Each of these scripts is basically identical, and all were too brittle.
Now they should be more resilient and easier to manage.  The script
still needs to be updated if we add new ones, which I do not love.

More cleanup to follow.

Kubernetes-commit: e0ecccff3f5148cc167117ac73233b4edc1640d8
2023-01-05 13:53:59 -08:00
Tim Hockin c1747f501f Fix kubelet-plugin-registration to add missing dir
include v1

This is far too manual for my tastes, which will be fixed subsequently.

Kubernetes-commit: 01e1da77e29d14b12c05cda6928fd55688f9b49f
2023-01-04 14:36:40 -08:00
Tim Hockin 5b9f32bd9e Fix generated-pod-resources to add missing dir
include v1alpha1

This is too manual - will be fixed subsequently

Kubernetes-commit: 4e48506245ede8cc427b35e2d4d0b39495799e2f
2023-01-04 14:42:32 -08:00
Ed Bartosh 94804a4df3 kubelet: add support for dynamic resource allocation
Dependencies need to be updated to use
github.com/container-orchestrated-devices/container-device-interface.

It's not decided yet whether we will implement Topology support
for DRA or not. Not having any toppology-related code
will help to avoid wrong impression that DRA is used as a hint
provider for the Topology Manager.

Kubernetes-commit: ae0f38437cbb5c2b515384cb9f7dea5d808b87c4
2022-07-15 14:28:18 +03:00
Dixita Narang f111908a77 Adding files generated from running make generate and update commands
Kubernetes-commit: 875920037a072ec9b34d598795a69f5c3ea8eaa3
2022-09-07 21:35:46 +00:00
Dixita Narang b08fd49123 Renaming usage of v1beta1 to v1, and adding API violation exceptions and
vendor module for v1

Kubernetes-commit: 977a8ebb3a4be17d14c11476c27bd77a80e8ef32
2022-08-01 19:21:30 +00:00
Dixita Narang be0bf1c6ed Copying over credentialprovider v1beta1 packages to v1
Kubernetes-commit: 87f1102ee92a0a37bc6ffaba0d2b68a6689f980d
2022-08-01 18:18:02 +00:00
Davanum Srinivas 279c758121 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
Kubernetes Prow Robot f260aecdca Merge pull request #105585 from fengzixu/improvement-volume-health
add volume kubelet_volume_stats_health_abnormal to kubelet

Kubernetes-commit: 5cb6fab8f6336990cc58f7cb6abffc6ad178121b
2022-03-15 05:58:11 -07:00
Aditi Sharma f53431b6d9 Move feature flag credential provider to beta
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>

Kubernetes-commit: ed16ef22061a8246236e0049a34d7cf305462e34
2022-03-21 17:55:07 +05:30