mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rebase: update K8s packages to v0.32.1
Update K8s packages in go.mod to v0.32.1 Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
5377
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go
generated
vendored
Normal file
5377
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
223
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto
generated
vendored
Normal file
223
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto
generated
vendored
Normal file
@ -0,0 +1,223 @@
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
syntax = "proto3";
|
||||
|
||||
package v1beta1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
|
||||
// Registration is the service advertised by the Kubelet
|
||||
// Only when Kubelet answers with a success code to a Register Request
|
||||
// may Device Plugins start their service
|
||||
// Registration may fail when device plugin version is not supported by
|
||||
// Kubelet or the registered resourceName is already taken by another
|
||||
// active device plugin. Device plugin is expected to terminate upon registration failure
|
||||
service Registration {
|
||||
rpc Register(RegisterRequest) returns (Empty) {}
|
||||
}
|
||||
|
||||
message DevicePluginOptions {
|
||||
// Indicates if PreStartContainer call is required before each container start
|
||||
bool pre_start_required = 1;
|
||||
// Indicates if GetPreferredAllocation is implemented and available for calling
|
||||
bool get_preferred_allocation_available = 2;
|
||||
}
|
||||
|
||||
message RegisterRequest {
|
||||
// Version of the API the Device Plugin was built against
|
||||
string version = 1;
|
||||
// Name of the unix socket the device plugin is listening on
|
||||
// PATH = path.Join(DevicePluginPath, endpoint)
|
||||
string endpoint = 2;
|
||||
// Schedulable resource name. As of now it's expected to be a DNS Label
|
||||
string resource_name = 3;
|
||||
// Options to be communicated with Device Manager
|
||||
DevicePluginOptions options = 4;
|
||||
}
|
||||
|
||||
message Empty {
|
||||
}
|
||||
|
||||
// DevicePlugin is the service advertised by Device Plugins
|
||||
service DevicePlugin {
|
||||
// GetDevicePluginOptions returns options to be communicated with Device
|
||||
// Manager
|
||||
rpc GetDevicePluginOptions(Empty) returns (DevicePluginOptions) {}
|
||||
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state change or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
rpc ListAndWatch(Empty) returns (stream ListAndWatchResponse) {}
|
||||
|
||||
// GetPreferredAllocation returns a preferred set of devices to allocate
|
||||
// from a list of available ones. The resulting preferred allocation is not
|
||||
// guaranteed to be the allocation ultimately performed by the
|
||||
// devicemanager. It is only designed to help the devicemanager make a more
|
||||
// informed allocation decision when possible.
|
||||
rpc GetPreferredAllocation(PreferredAllocationRequest) returns (PreferredAllocationResponse) {}
|
||||
|
||||
// Allocate is called during container creation so that the Device
|
||||
// Plugin can run device specific operations and instruct Kubelet
|
||||
// of the steps to make the Device available in the container
|
||||
rpc Allocate(AllocateRequest) returns (AllocateResponse) {}
|
||||
|
||||
// PreStartContainer is called, if indicated by Device Plugin during registeration phase,
|
||||
// before each container start. Device plugin can run device specific operations
|
||||
// such as resetting the device before making devices available to the container
|
||||
rpc PreStartContainer(PreStartContainerRequest) returns (PreStartContainerResponse) {}
|
||||
}
|
||||
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state change or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
message ListAndWatchResponse {
|
||||
repeated Device devices = 1;
|
||||
}
|
||||
|
||||
message TopologyInfo {
|
||||
repeated NUMANode nodes = 1;
|
||||
}
|
||||
|
||||
message NUMANode {
|
||||
int64 ID = 1;
|
||||
}
|
||||
|
||||
/* E.g:
|
||||
* struct Device {
|
||||
* ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e",
|
||||
* Health: "Healthy",
|
||||
* Topology:
|
||||
* Node:
|
||||
* ID: 1
|
||||
*} */
|
||||
message Device {
|
||||
// A unique ID assigned by the device plugin used
|
||||
// to identify devices during the communication
|
||||
// Max length of this field is 63 characters
|
||||
string ID = 1;
|
||||
// Health of the device, can be healthy or unhealthy, see constants.go
|
||||
string health = 2;
|
||||
// Topology for device
|
||||
TopologyInfo topology = 3;
|
||||
}
|
||||
|
||||
// - PreStartContainer is expected to be called before each container start if indicated by plugin during registration phase.
|
||||
// - PreStartContainer allows kubelet to pass reinitialized devices to containers.
|
||||
// - PreStartContainer allows Device Plugin to run device specific operations on
|
||||
// the Devices requested
|
||||
message PreStartContainerRequest {
|
||||
repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"];
|
||||
}
|
||||
|
||||
// PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest
|
||||
message PreStartContainerResponse {
|
||||
}
|
||||
|
||||
// PreferredAllocationRequest is passed via a call to GetPreferredAllocation()
|
||||
// at pod admission time. The device plugin should take the list of
|
||||
// `available_deviceIDs` and calculate a preferred allocation of size
|
||||
// 'allocation_size' from them, making sure to include the set of devices
|
||||
// listed in 'must_include_deviceIDs'.
|
||||
message PreferredAllocationRequest {
|
||||
repeated ContainerPreferredAllocationRequest container_requests = 1;
|
||||
}
|
||||
|
||||
message ContainerPreferredAllocationRequest {
|
||||
// List of available deviceIDs from which to choose a preferred allocation
|
||||
repeated string available_deviceIDs = 1;
|
||||
// List of deviceIDs that must be included in the preferred allocation
|
||||
repeated string must_include_deviceIDs = 2;
|
||||
// Number of devices to include in the preferred allocation
|
||||
int32 allocation_size = 3;
|
||||
}
|
||||
|
||||
// PreferredAllocationResponse returns a preferred allocation,
|
||||
// resulting from a PreferredAllocationRequest.
|
||||
message PreferredAllocationResponse {
|
||||
repeated ContainerPreferredAllocationResponse container_responses = 1;
|
||||
}
|
||||
|
||||
message ContainerPreferredAllocationResponse {
|
||||
repeated string deviceIDs = 1;
|
||||
}
|
||||
|
||||
// - Allocate is expected to be called during pod creation since allocation
|
||||
// failures for any container would result in pod startup failure.
|
||||
// - Allocate allows kubelet to exposes additional artifacts in a pod's
|
||||
// environment as directed by the plugin.
|
||||
// - Allocate allows Device Plugin to run device specific operations on
|
||||
// the Devices requested
|
||||
message AllocateRequest {
|
||||
repeated ContainerAllocateRequest container_requests = 1;
|
||||
}
|
||||
|
||||
message ContainerAllocateRequest {
|
||||
repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"];
|
||||
}
|
||||
|
||||
// CDIDevice specifies a CDI device information.
|
||||
message CDIDevice {
|
||||
// Fully qualified CDI device name
|
||||
// for example: vendor.com/gpu=gpudevice1
|
||||
// see more details in the CDI specification:
|
||||
// https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// AllocateResponse includes the artifacts that needs to be injected into
|
||||
// a container for accessing 'deviceIDs' that were mentioned as part of
|
||||
// 'AllocateRequest'.
|
||||
// Failure Handling:
|
||||
// if Kubelet sends an allocation request for dev1 and dev2.
|
||||
// Allocation on dev1 succeeds but allocation on dev2 fails.
|
||||
// The Device plugin should send a ListAndWatch update and fail the
|
||||
// Allocation request
|
||||
message AllocateResponse {
|
||||
repeated ContainerAllocateResponse container_responses = 1;
|
||||
}
|
||||
|
||||
message ContainerAllocateResponse {
|
||||
// List of environment variable to be set in the container to access one of more devices.
|
||||
map<string, string> envs = 1;
|
||||
// Mounts for the container.
|
||||
repeated Mount mounts = 2;
|
||||
// Devices for the container.
|
||||
repeated DeviceSpec devices = 3;
|
||||
// Container annotations to pass to the container runtime
|
||||
map<string, string> annotations = 4;
|
||||
// CDI devices for the container.
|
||||
repeated CDIDevice cdi_devices = 5 [(gogoproto.customname) = "CDIDevices"];
|
||||
}
|
||||
|
||||
// Mount specifies a host volume to mount into a container.
|
||||
// where device library or tools are installed on host and container
|
||||
message Mount {
|
||||
// Path of the mount within the container.
|
||||
string container_path = 1;
|
||||
// Path of the mount on the host.
|
||||
string host_path = 2;
|
||||
// If set, the mount is read-only.
|
||||
bool read_only = 3;
|
||||
}
|
||||
|
||||
// DeviceSpec specifies a host device to mount into a container.
|
||||
message DeviceSpec {
|
||||
// Path of the device within the container.
|
||||
string container_path = 1;
|
||||
// Path of the device on the host.
|
||||
string host_path = 2;
|
||||
// Cgroups permissions of the device, candidates are one or more of
|
||||
// * r - allows container to read from the specified device.
|
||||
// * w - allows container to write to the specified device.
|
||||
// * m - allows container to create device files that do not yet exist.
|
||||
string permissions = 3;
|
||||
}
|
48
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/constants.go
generated
vendored
Normal file
48
vendor/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/constants.go
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
const (
|
||||
// Healthy means that the device is healthy
|
||||
Healthy = "Healthy"
|
||||
// Unhealthy means that the device is unhealthy
|
||||
Unhealthy = "Unhealthy"
|
||||
|
||||
// Version means current version of the API supported by kubelet
|
||||
Version = "v1beta1"
|
||||
// DevicePluginPath is the folder the Device Plugin is expecting sockets to be on
|
||||
// Only privileged pods have access to this path
|
||||
// Note: Placeholder until we find a "standard path"
|
||||
DevicePluginPath = "/var/lib/kubelet/device-plugins/"
|
||||
// KubeletSocket is the path of the Kubelet registry socket
|
||||
KubeletSocket = DevicePluginPath + "kubelet.sock"
|
||||
|
||||
// DevicePluginPathWindows Avoid failed to run Kubelet: bad socketPath,
|
||||
// must be an absolute path: /var/lib/kubelet/device-plugins/kubelet.sock
|
||||
// https://github.com/kubernetes/kubernetes/issues/93262
|
||||
// https://github.com/kubernetes/kubernetes/pull/93285#discussion_r458140701
|
||||
DevicePluginPathWindows = "\\var\\lib\\kubelet\\device-plugins\\"
|
||||
// KubeletSocketWindows is the path of the Kubelet registry socket on windows
|
||||
KubeletSocketWindows = DevicePluginPathWindows + "kubelet.sock"
|
||||
|
||||
// KubeletPreStartContainerRPCTimeoutInSecs is the timeout duration in secs for PreStartContainer RPC
|
||||
// Timeout duration in secs for PreStartContainer RPC
|
||||
KubeletPreStartContainerRPCTimeoutInSecs = 30
|
||||
)
|
||||
|
||||
// SupportedVersions provides a list of supported version
|
||||
var SupportedVersions = [...]string{"v1beta1"}
|
2448
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.pb.go
generated
vendored
Normal file
2448
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
117
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.proto
generated
vendored
Normal file
117
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/api.proto
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
Copyright 2023 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package v1alpha3;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha4";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
service Node {
|
||||
// NodePrepareResources prepares several ResourceClaims
|
||||
// for use on the node. If an error is returned, the
|
||||
// response is ignored. Failures for individual claims
|
||||
// can be reported inside NodePrepareResourcesResponse.
|
||||
rpc NodePrepareResources (NodePrepareResourcesRequest)
|
||||
returns (NodePrepareResourcesResponse) {}
|
||||
|
||||
// NodeUnprepareResources is the opposite of NodePrepareResources.
|
||||
// The same error handling rules apply,
|
||||
rpc NodeUnprepareResources (NodeUnprepareResourcesRequest)
|
||||
returns (NodeUnprepareResourcesResponse) {}
|
||||
}
|
||||
|
||||
message NodePrepareResourcesRequest {
|
||||
// The list of ResourceClaims that are to be prepared.
|
||||
repeated Claim claims = 1;
|
||||
}
|
||||
|
||||
message NodePrepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was done
|
||||
// or attempted, with claim_uid as key.
|
||||
//
|
||||
// It is an error if some claim listed in NodePrepareResourcesRequest
|
||||
// does not get prepared. NodePrepareResources
|
||||
// will be called again for those that are missing.
|
||||
map<string, NodePrepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
||||
message NodePrepareResourceResponse {
|
||||
// These are the additional devices that kubelet must
|
||||
// make available via the container runtime. A claim
|
||||
// may have zero or more requests and each request
|
||||
// may have zero or more devices.
|
||||
repeated Device devices = 1;
|
||||
// If non-empty, preparing the ResourceClaim failed.
|
||||
// Devices are ignored in that case.
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
message Device {
|
||||
// The requests in the claim that this device is associated with.
|
||||
// Optional. If empty, the device is associated with all requests.
|
||||
repeated string request_names = 1;
|
||||
|
||||
// The pool which contains the device. Required.
|
||||
string pool_name = 2;
|
||||
|
||||
// The device itself. Required.
|
||||
string device_name = 3;
|
||||
|
||||
// A single device instance may map to several CDI device IDs.
|
||||
// None is also valid.
|
||||
repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"];
|
||||
}
|
||||
|
||||
message NodeUnprepareResourcesRequest {
|
||||
// The list of ResourceClaims that are to be unprepared.
|
||||
repeated Claim claims = 1;
|
||||
}
|
||||
|
||||
message NodeUnprepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
map<string, NodeUnprepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
||||
message NodeUnprepareResourceResponse {
|
||||
// If non-empty, unpreparing the ResourceClaim failed.
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message Claim {
|
||||
// The ResourceClaim namespace (ResourceClaim.meta.Namespace).
|
||||
// This field is REQUIRED.
|
||||
string namespace = 1;
|
||||
// The UID of the Resource claim (ResourceClaim.meta.UUID).
|
||||
// This field is REQUIRED.
|
||||
string uid = 2 [(gogoproto.customname) = "UID"];
|
||||
// The name of the Resource claim (ResourceClaim.meta.Name)
|
||||
// This field is REQUIRED.
|
||||
string name = 3;
|
||||
}
|
187
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/conversion.go
generated
vendored
Normal file
187
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/conversion.go
generated
vendored
Normal file
@ -0,0 +1,187 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha4
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubelet/pkg/apis/dra/v1beta1"
|
||||
)
|
||||
|
||||
var (
|
||||
localSchemeBuilder runtime.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// V1Beta1ServerWrapper implements the [NodeServer] interface by wrapping a [v1beta1.DRAPluginServer].
|
||||
type V1Beta1ServerWrapper struct {
|
||||
v1beta1.DRAPluginServer
|
||||
}
|
||||
|
||||
var _ NodeServer = V1Beta1ServerWrapper{}
|
||||
|
||||
func (w V1Beta1ServerWrapper) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) {
|
||||
var convertedReq v1beta1.NodePrepareResourcesRequest
|
||||
if err := Convert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodePrepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodePrepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Beta1ServerWrapper) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq v1beta1.NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodeUnprepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1Alpha4ServerWrapper implements the [v1beta1.DRAPluginServer] interface by wrapping a [NodeServer].
|
||||
type V1Alpha4ServerWrapper struct {
|
||||
NodeServer
|
||||
}
|
||||
|
||||
var _ v1beta1.DRAPluginServer = V1Alpha4ServerWrapper{}
|
||||
|
||||
func (w V1Alpha4ServerWrapper) NodePrepareResources(ctx context.Context, req *v1beta1.NodePrepareResourcesRequest) (*v1beta1.NodePrepareResourcesResponse, error) {
|
||||
var convertedReq NodePrepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
resp, err := w.NodeServer.NodePrepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1beta1.NodePrepareResourcesResponse
|
||||
if err := Convert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Alpha4ServerWrapper) NodeUnprepareResources(ctx context.Context, req *v1beta1.NodeUnprepareResourcesRequest) (*v1beta1.NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
resp, err := w.NodeServer.NodeUnprepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1beta1.NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1Beta1ClientWrapper implements the [NodeClient] interface by wrapping a [v1beta1.DRAPluginClient].
|
||||
type V1Beta1ClientWrapper struct {
|
||||
v1beta1.DRAPluginClient
|
||||
}
|
||||
|
||||
var _ NodeClient = V1Beta1ClientWrapper{}
|
||||
|
||||
func (w V1Beta1ClientWrapper) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest, options ...grpc.CallOption) (*NodePrepareResourcesResponse, error) {
|
||||
var convertedReq v1beta1.NodePrepareResourcesRequest
|
||||
if err := Convert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodePrepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodePrepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Beta1ClientWrapper) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest, options ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq v1beta1.NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodeUnprepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1Alpha4ClientWrapper implements the [v1beta1.DRAPluginClient] interface by wrapping a [NodeClient].
|
||||
type V1Alpha4ClientWrapper struct {
|
||||
NodeClient
|
||||
}
|
||||
|
||||
var _ v1beta1.DRAPluginClient = V1Alpha4ClientWrapper{}
|
||||
|
||||
func (w V1Alpha4ClientWrapper) NodePrepareResources(ctx context.Context, req *v1beta1.NodePrepareResourcesRequest, options ...grpc.CallOption) (*v1beta1.NodePrepareResourcesResponse, error) {
|
||||
var convertedReq NodePrepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
resp, err := w.NodeClient.NodePrepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1beta1.NodePrepareResourcesResponse
|
||||
if err := Convert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Alpha4ClientWrapper) NodeUnprepareResources(ctx context.Context, req *v1beta1.NodeUnprepareResourcesRequest, options ...grpc.CallOption) (*v1beta1.NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1beta1 to v1alpha4: %w", err)
|
||||
}
|
||||
resp, err := w.NodeClient.NodeUnprepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1beta1.NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1alpha4 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
21
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/doc.go
generated
vendored
Normal file
21
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/doc.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha4 contains a legacy implementation of the DRA gRPC
|
||||
// interface. Support for it in kubelet is provided via conversion.
|
||||
//
|
||||
// +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/dra/v1beta1
|
||||
package v1alpha4
|
30
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/types.go
generated
vendored
Normal file
30
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/types.go
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha4
|
||||
|
||||
const (
|
||||
// NodeService should be listed in the "supported versions"
|
||||
// array during plugin registration by a DRA plugin which provides
|
||||
// an implementation of the v1alpha3 Node service.
|
||||
//
|
||||
// This convention was introduced in Kubernetes 1.32. Older DRA
|
||||
// plugins provide the implementation without advertising it.
|
||||
//
|
||||
// For historic reasons (= a mistake...) there is a mismatch between
|
||||
// the package name and gRPC version.
|
||||
NodeService = "v1alpha3.NodeService"
|
||||
)
|
324
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/zz_generated.conversion.go
generated
vendored
Normal file
324
vendor/k8s.io/kubelet/pkg/apis/dra/v1alpha4/zz_generated.conversion.go
generated
vendored
Normal file
@ -0,0 +1,324 @@
|
||||
//go:build !ignore_autogenerated
|
||||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by conversion-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha4
|
||||
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1beta1 "k8s.io/kubelet/pkg/apis/dra/v1beta1"
|
||||
)
|
||||
|
||||
func init() {
|
||||
localSchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(s *runtime.Scheme) error {
|
||||
if err := s.AddGeneratedConversionFunc((*Claim)(nil), (*v1beta1.Claim)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_Claim_To_v1beta1_Claim(a.(*Claim), b.(*v1beta1.Claim), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.Claim)(nil), (*Claim)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_Claim_To_v1alpha4_Claim(a.(*v1beta1.Claim), b.(*Claim), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*Device)(nil), (*v1beta1.Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_Device_To_v1beta1_Device(a.(*Device), b.(*v1beta1.Device), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.Device)(nil), (*Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_Device_To_v1alpha4_Device(a.(*v1beta1.Device), b.(*Device), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourceResponse)(nil), (*v1beta1.NodePrepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(a.(*NodePrepareResourceResponse), b.(*v1beta1.NodePrepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodePrepareResourceResponse)(nil), (*NodePrepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourceResponse_To_v1alpha4_NodePrepareResourceResponse(a.(*v1beta1.NodePrepareResourceResponse), b.(*NodePrepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourcesRequest)(nil), (*v1beta1.NodePrepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(a.(*NodePrepareResourcesRequest), b.(*v1beta1.NodePrepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodePrepareResourcesRequest)(nil), (*NodePrepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(a.(*v1beta1.NodePrepareResourcesRequest), b.(*NodePrepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourcesResponse)(nil), (*v1beta1.NodePrepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(a.(*NodePrepareResourcesResponse), b.(*v1beta1.NodePrepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodePrepareResourcesResponse)(nil), (*NodePrepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(a.(*v1beta1.NodePrepareResourcesResponse), b.(*NodePrepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourceResponse)(nil), (*v1beta1.NodeUnprepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(a.(*NodeUnprepareResourceResponse), b.(*v1beta1.NodeUnprepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodeUnprepareResourceResponse)(nil), (*NodeUnprepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourceResponse_To_v1alpha4_NodeUnprepareResourceResponse(a.(*v1beta1.NodeUnprepareResourceResponse), b.(*NodeUnprepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourcesRequest)(nil), (*v1beta1.NodeUnprepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(a.(*NodeUnprepareResourcesRequest), b.(*v1beta1.NodeUnprepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodeUnprepareResourcesRequest)(nil), (*NodeUnprepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(a.(*v1beta1.NodeUnprepareResourcesRequest), b.(*NodeUnprepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourcesResponse)(nil), (*v1beta1.NodeUnprepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(a.(*NodeUnprepareResourcesResponse), b.(*v1beta1.NodeUnprepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1beta1.NodeUnprepareResourcesResponse)(nil), (*NodeUnprepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(a.(*v1beta1.NodeUnprepareResourcesResponse), b.(*NodeUnprepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_Claim_To_v1beta1_Claim(in *Claim, out *v1beta1.Claim, s conversion.Scope) error {
|
||||
out.Namespace = in.Namespace
|
||||
out.UID = in.UID
|
||||
out.Name = in.Name
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_Claim_To_v1beta1_Claim is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_Claim_To_v1beta1_Claim(in *Claim, out *v1beta1.Claim, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_Claim_To_v1beta1_Claim(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_Claim_To_v1alpha4_Claim(in *v1beta1.Claim, out *Claim, s conversion.Scope) error {
|
||||
out.Namespace = in.Namespace
|
||||
out.UID = in.UID
|
||||
out.Name = in.Name
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_Claim_To_v1alpha4_Claim is an autogenerated conversion function.
|
||||
func Convert_v1beta1_Claim_To_v1alpha4_Claim(in *v1beta1.Claim, out *Claim, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_Claim_To_v1alpha4_Claim(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_Device_To_v1beta1_Device(in *Device, out *v1beta1.Device, s conversion.Scope) error {
|
||||
out.RequestNames = *(*[]string)(unsafe.Pointer(&in.RequestNames))
|
||||
out.PoolName = in.PoolName
|
||||
out.DeviceName = in.DeviceName
|
||||
out.CDIDeviceIDs = *(*[]string)(unsafe.Pointer(&in.CDIDeviceIDs))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_Device_To_v1beta1_Device is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_Device_To_v1beta1_Device(in *Device, out *v1beta1.Device, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_Device_To_v1beta1_Device(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_Device_To_v1alpha4_Device(in *v1beta1.Device, out *Device, s conversion.Scope) error {
|
||||
out.RequestNames = *(*[]string)(unsafe.Pointer(&in.RequestNames))
|
||||
out.PoolName = in.PoolName
|
||||
out.DeviceName = in.DeviceName
|
||||
out.CDIDeviceIDs = *(*[]string)(unsafe.Pointer(&in.CDIDeviceIDs))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_Device_To_v1alpha4_Device is an autogenerated conversion function.
|
||||
func Convert_v1beta1_Device_To_v1alpha4_Device(in *v1beta1.Device, out *Device, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_Device_To_v1alpha4_Device(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in *NodePrepareResourceResponse, out *v1beta1.NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
out.Devices = *(*[]*v1beta1.Device)(unsafe.Pointer(&in.Devices))
|
||||
out.Error = in.Error
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in *NodePrepareResourceResponse, out *v1beta1.NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourceResponse_To_v1alpha4_NodePrepareResourceResponse(in *v1beta1.NodePrepareResourceResponse, out *NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
out.Devices = *(*[]*Device)(unsafe.Pointer(&in.Devices))
|
||||
out.Error = in.Error
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodePrepareResourceResponse_To_v1alpha4_NodePrepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourceResponse_To_v1alpha4_NodePrepareResourceResponse(in *v1beta1.NodePrepareResourceResponse, out *NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourceResponse_To_v1alpha4_NodePrepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in *NodePrepareResourcesRequest, out *v1beta1.NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*v1beta1.Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in *NodePrepareResourcesRequest, out *v1beta1.NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(in *v1beta1.NodePrepareResourcesRequest, out *NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(in *v1beta1.NodePrepareResourcesRequest, out *NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourcesRequest_To_v1alpha4_NodePrepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in *NodePrepareResourcesResponse, out *v1beta1.NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*v1beta1.NodePrepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in *NodePrepareResourcesResponse, out *v1beta1.NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(in *v1beta1.NodePrepareResourcesResponse, out *NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*NodePrepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(in *v1beta1.NodePrepareResourcesResponse, out *NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourcesResponse_To_v1alpha4_NodePrepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in *NodeUnprepareResourceResponse, out *v1beta1.NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
out.Error = in.Error
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in *NodeUnprepareResourceResponse, out *v1beta1.NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourceResponse_To_v1alpha4_NodeUnprepareResourceResponse(in *v1beta1.NodeUnprepareResourceResponse, out *NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
out.Error = in.Error
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodeUnprepareResourceResponse_To_v1alpha4_NodeUnprepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourceResponse_To_v1alpha4_NodeUnprepareResourceResponse(in *v1beta1.NodeUnprepareResourceResponse, out *NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourceResponse_To_v1alpha4_NodeUnprepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in *NodeUnprepareResourcesRequest, out *v1beta1.NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*v1beta1.Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in *NodeUnprepareResourcesRequest, out *v1beta1.NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(in *v1beta1.NodeUnprepareResourcesRequest, out *NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(in *v1beta1.NodeUnprepareResourcesRequest, out *NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourcesRequest_To_v1alpha4_NodeUnprepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in *NodeUnprepareResourcesResponse, out *v1beta1.NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*v1beta1.NodeUnprepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in *NodeUnprepareResourcesResponse, out *v1beta1.NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1alpha4_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(in *v1beta1.NodeUnprepareResourcesResponse, out *NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*NodeUnprepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(in *v1beta1.NodeUnprepareResourcesResponse, out *NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourcesResponse_To_v1alpha4_NodeUnprepareResourcesResponse(in, out, s)
|
||||
}
|
2449
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.pb.go
generated
vendored
Normal file
2449
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
117
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.proto
generated
vendored
Normal file
117
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/api.proto
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
package k8s.io.kubelet.pkg.apis.dra.v1beta1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1beta1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
service DRAPlugin {
|
||||
// NodePrepareResources prepares several ResourceClaims
|
||||
// for use on the node. If an error is returned, the
|
||||
// response is ignored. Failures for individual claims
|
||||
// can be reported inside NodePrepareResourcesResponse.
|
||||
rpc NodePrepareResources (NodePrepareResourcesRequest)
|
||||
returns (NodePrepareResourcesResponse) {}
|
||||
|
||||
// NodeUnprepareResources is the opposite of NodePrepareResources.
|
||||
// The same error handling rules apply,
|
||||
rpc NodeUnprepareResources (NodeUnprepareResourcesRequest)
|
||||
returns (NodeUnprepareResourcesResponse) {}
|
||||
}
|
||||
|
||||
message NodePrepareResourcesRequest {
|
||||
// The list of ResourceClaims that are to be prepared.
|
||||
repeated Claim claims = 1;
|
||||
}
|
||||
|
||||
message NodePrepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was done
|
||||
// or attempted, with claim_uid as key.
|
||||
//
|
||||
// It is an error if some claim listed in NodePrepareResourcesRequest
|
||||
// does not get prepared. NodePrepareResources
|
||||
// will be called again for those that are missing.
|
||||
map<string, NodePrepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
||||
message NodePrepareResourceResponse {
|
||||
// These are the additional devices that kubelet must
|
||||
// make available via the container runtime. A claim
|
||||
// may have zero or more requests and each request
|
||||
// may have zero or more devices.
|
||||
repeated Device devices = 1;
|
||||
// If non-empty, preparing the ResourceClaim failed.
|
||||
// Devices are ignored in that case.
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
message Device {
|
||||
// The requests in the claim that this device is associated with.
|
||||
// Optional. If empty, the device is associated with all requests.
|
||||
repeated string request_names = 1;
|
||||
|
||||
// The pool which contains the device. Required.
|
||||
string pool_name = 2;
|
||||
|
||||
// The device itself. Required.
|
||||
string device_name = 3;
|
||||
|
||||
// A single device instance may map to several CDI device IDs.
|
||||
// None is also valid.
|
||||
repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"];
|
||||
}
|
||||
|
||||
message NodeUnprepareResourcesRequest {
|
||||
// The list of ResourceClaims that are to be unprepared.
|
||||
repeated Claim claims = 1;
|
||||
}
|
||||
|
||||
message NodeUnprepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
map<string, NodeUnprepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
||||
message NodeUnprepareResourceResponse {
|
||||
// If non-empty, unpreparing the ResourceClaim failed.
|
||||
string error = 1;
|
||||
}
|
||||
|
||||
message Claim {
|
||||
// The ResourceClaim namespace (ResourceClaim.meta.Namespace).
|
||||
// This field is REQUIRED.
|
||||
string namespace = 1;
|
||||
// The UID of the Resource claim (ResourceClaim.meta.UUID).
|
||||
// This field is REQUIRED.
|
||||
string uid = 2 [(gogoproto.customname) = "UID"];
|
||||
// The name of the Resource claim (ResourceClaim.meta.Name)
|
||||
// This field is REQUIRED.
|
||||
string name = 3;
|
||||
}
|
24
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/types.go
generated
vendored
Normal file
24
vendor/k8s.io/kubelet/pkg/apis/dra/v1beta1/types.go
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1beta1
|
||||
|
||||
const (
|
||||
// DRAPluginService needs to be listed in the "supported versions"
|
||||
// array during plugin registration by a DRA plugin which provides
|
||||
// an implementation of the v1beta1 DRAPlugin service.
|
||||
DRAPluginService = "v1beta1.DRAPlugin"
|
||||
)
|
1148
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.pb.go
generated
vendored
Normal file
1148
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
61
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.proto
generated
vendored
Normal file
61
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.proto
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
syntax = "proto3";
|
||||
|
||||
package pluginregistration; // This should have been v1.
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/pluginregistration/v1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
// PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration
|
||||
message PluginInfo {
|
||||
// Type of the Plugin. CSIPlugin or DevicePlugin
|
||||
string type = 1;
|
||||
// Plugin name that uniquely identifies the plugin for the given plugin type.
|
||||
// For DevicePlugin, this is the resource name that the plugin manages and
|
||||
// should follow the extended resource name convention.
|
||||
// For CSI, this is the CSI driver registrar name.
|
||||
string name = 2;
|
||||
// Optional endpoint location. If found set by Kubelet component,
|
||||
// Kubelet component will use this endpoint for specific requests.
|
||||
// This allows the plugin to register using one endpoint and possibly use
|
||||
// a different socket for control operations. CSI uses this model to delegate
|
||||
// its registration external from the plugin.
|
||||
string endpoint = 3;
|
||||
// Plugin service API versions the plugin supports.
|
||||
// For DevicePlugin, this maps to the deviceplugin API versions the
|
||||
// plugin supports at the given socket.
|
||||
// The Kubelet component communicating with the plugin should be able
|
||||
// to choose any preferred version from this list, or returns an error
|
||||
// if none of the listed versions is supported.
|
||||
repeated string supported_versions = 4;
|
||||
}
|
||||
|
||||
// RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status
|
||||
message RegistrationStatus {
|
||||
// True if plugin gets registered successfully at Kubelet
|
||||
bool plugin_registered = 1;
|
||||
// Error message in case plugin fails to register, empty string otherwise
|
||||
string error = 2;
|
||||
}
|
||||
|
||||
// RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC
|
||||
message RegistrationStatusResponse {
|
||||
}
|
||||
|
||||
// InfoRequest is the empty request message from Kubelet
|
||||
message InfoRequest {
|
||||
}
|
||||
|
||||
// Registration is the service advertised by the Plugins.
|
||||
service Registration {
|
||||
rpc GetInfo(InfoRequest) returns (PluginInfo) {}
|
||||
rpc NotifyRegistrationStatus(RegistrationStatus) returns (RegistrationStatusResponse) {}
|
||||
}
|
26
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/constants.go
generated
vendored
Normal file
26
vendor/k8s.io/kubelet/pkg/apis/pluginregistration/v1/constants.go
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright 2018 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1
|
||||
|
||||
const (
|
||||
// CSIPlugin identifier for registered CSI plugins
|
||||
CSIPlugin = "CSIPlugin"
|
||||
// DevicePlugin identifier for registered device plugins
|
||||
DevicePlugin = "DevicePlugin"
|
||||
// DRAPlugin identifier for registered Dynamic Resourc Allocation plugins
|
||||
DRAPlugin = "DRAPlugin"
|
||||
)
|
4214
vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go
generated
vendored
Normal file
4214
vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
121
vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto
generated
vendored
Normal file
121
vendor/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto
generated
vendored
Normal file
@ -0,0 +1,121 @@
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
syntax = "proto3";
|
||||
|
||||
package v1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/podresources/v1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
service PodResourcesLister {
|
||||
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {}
|
||||
rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {}
|
||||
rpc Get(GetPodResourcesRequest) returns (GetPodResourcesResponse) {}
|
||||
}
|
||||
|
||||
message AllocatableResourcesRequest {}
|
||||
|
||||
// AllocatableResourcesResponses contains informations about all the devices known by the kubelet
|
||||
message AllocatableResourcesResponse {
|
||||
repeated ContainerDevices devices = 1;
|
||||
repeated int64 cpu_ids = 2;
|
||||
repeated ContainerMemory memory = 3;
|
||||
}
|
||||
|
||||
// ListPodResourcesRequest is the request made to the PodResourcesLister service
|
||||
message ListPodResourcesRequest {}
|
||||
|
||||
// ListPodResourcesResponse is the response returned by List function
|
||||
message ListPodResourcesResponse {
|
||||
repeated PodResources pod_resources = 1;
|
||||
}
|
||||
|
||||
// PodResources contains information about the node resources assigned to a pod
|
||||
message PodResources {
|
||||
string name = 1;
|
||||
string namespace = 2;
|
||||
repeated ContainerResources containers = 3;
|
||||
}
|
||||
|
||||
// ContainerResources contains information about the resources assigned to a container
|
||||
message ContainerResources {
|
||||
string name = 1;
|
||||
repeated ContainerDevices devices = 2;
|
||||
repeated int64 cpu_ids = 3;
|
||||
repeated ContainerMemory memory = 4;
|
||||
repeated DynamicResource dynamic_resources = 5;
|
||||
}
|
||||
|
||||
// ContainerMemory contains information about memory and hugepages assigned to a container
|
||||
message ContainerMemory {
|
||||
string memory_type = 1;
|
||||
uint64 size = 2;
|
||||
TopologyInfo topology = 3;
|
||||
}
|
||||
|
||||
// ContainerDevices contains information about the devices assigned to a container
|
||||
message ContainerDevices {
|
||||
string resource_name = 1;
|
||||
repeated string device_ids = 2;
|
||||
TopologyInfo topology = 3;
|
||||
}
|
||||
|
||||
// Topology describes hardware topology of the resource
|
||||
message TopologyInfo {
|
||||
repeated NUMANode nodes = 1;
|
||||
}
|
||||
|
||||
// NUMA representation of NUMA node
|
||||
message NUMANode {
|
||||
int64 ID = 1;
|
||||
}
|
||||
|
||||
// DynamicResource contains information about the devices assigned to a container by DRA
|
||||
message DynamicResource {
|
||||
// tombstone: removed in 1.31 because claims are no longer associated with one class
|
||||
// string class_name = 1;
|
||||
string claim_name = 2;
|
||||
string claim_namespace = 3;
|
||||
repeated ClaimResource claim_resources = 4;
|
||||
}
|
||||
|
||||
// ClaimResource contains resource information. The driver name/pool name/device name
|
||||
// triplet uniquely identifies the device. Should DRA get extended to other kinds
|
||||
// of resources, then device_name will be empty and other fields will get added.
|
||||
// Each device at the DRA API level may map to zero or more CDI devices.
|
||||
message ClaimResource {
|
||||
repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"];
|
||||
string driver_name = 2;
|
||||
string pool_name = 3;
|
||||
string device_name = 4;
|
||||
}
|
||||
|
||||
// CDIDevice specifies a CDI device information
|
||||
message CDIDevice {
|
||||
// Fully qualified CDI device name
|
||||
// for example: vendor.com/gpu=gpudevice1
|
||||
// see more details in the CDI specification:
|
||||
// https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
// GetPodResourcesRequest contains information about the pod
|
||||
message GetPodResourcesRequest {
|
||||
string pod_name = 1;
|
||||
string pod_namespace = 2;
|
||||
}
|
||||
|
||||
// GetPodResourcesResponse contains information about the pod the devices
|
||||
message GetPodResourcesResponse {
|
||||
PodResources pod_resources = 1;
|
||||
}
|
1387
vendor/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.pb.go
generated
vendored
Normal file
1387
vendor/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
49
vendor/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.proto
generated
vendored
Normal file
49
vendor/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.proto
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
syntax = "proto3";
|
||||
|
||||
package v1alpha1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/podresources/v1alpha1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
option (gogoproto.goproto_stringer_all) = false;
|
||||
option (gogoproto.stringer_all) = true;
|
||||
option (gogoproto.goproto_getters_all) = true;
|
||||
option (gogoproto.marshaler_all) = true;
|
||||
option (gogoproto.sizer_all) = true;
|
||||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
service PodResourcesLister {
|
||||
rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {}
|
||||
}
|
||||
|
||||
// ListPodResourcesRequest is the request made to the PodResourcesLister service
|
||||
message ListPodResourcesRequest {}
|
||||
|
||||
// ListPodResourcesResponse is the response returned by List function
|
||||
message ListPodResourcesResponse {
|
||||
repeated PodResources pod_resources = 1;
|
||||
}
|
||||
|
||||
// PodResources contains information about the node resources assigned to a pod
|
||||
message PodResources {
|
||||
string name = 1;
|
||||
string namespace = 2;
|
||||
repeated ContainerResources containers = 3;
|
||||
}
|
||||
|
||||
// ContainerResources contains information about the resources assigned to a container
|
||||
message ContainerResources {
|
||||
string name = 1;
|
||||
repeated ContainerDevices devices = 2;
|
||||
}
|
||||
|
||||
// ContainerDevices contains information about the devices assigned to a container
|
||||
message ContainerDevices {
|
||||
string resource_name = 1;
|
||||
repeated string device_ids = 2;
|
||||
}
|
Reference in New Issue
Block a user