Compare commits
56 Commits
v0.34.0-al
...
master
Author | SHA1 | Date |
---|---|---|
|
4181acbe82 | |
|
3f2038cdd5 | |
|
41474976ca | |
|
0c80555342 | |
|
46fc11a3c0 | |
|
925cb1b0b1 | |
|
af8a887450 | |
|
da40a40b6b | |
|
5717d42094 | |
|
1e11384ce9 | |
|
28e34b2552 | |
|
37e9a52015 | |
|
44b1bb21d1 | |
|
a14829b677 | |
|
f32abbb129 | |
|
a468151cb3 | |
|
3c7be0577a | |
|
91d07e0e87 | |
|
0272147844 | |
|
ca0bf778ee | |
|
27761cabf9 | |
|
646d6be365 | |
|
ac2b4c22fe | |
|
98b1f72f34 | |
|
1eb06f25c2 | |
|
1533e6cdf2 | |
|
7b85a43a87 | |
|
0774ca2465 | |
|
472567c8b2 | |
|
3f57b9b21b | |
|
1894255e90 | |
|
db9675bce2 | |
|
bbd1495a9a | |
|
3f36ffe508 | |
|
5b8a21b871 | |
|
c55cd031b0 | |
|
2ee42e8fb7 | |
|
42560ecbdd | |
|
9fb507f00c | |
|
02bc5ab467 | |
|
bb49f8beab | |
|
bfc52b8273 | |
|
f8c45c332f | |
|
0c944fc5e6 | |
|
ee9dc3d6e6 | |
|
b1b8e2064b | |
|
4defd3ee14 | |
|
7e87660cbe | |
|
9331a783e2 | |
|
af334a43a6 | |
|
c1c723b9ba | |
|
e5d04356ad | |
|
090c10d80f | |
|
e6033dfbf2 | |
|
255cf0f9e8 | |
|
c3d7806c38 |
|
@ -1,3 +1,8 @@
|
|||
> ⚠️ **This is an automatically published [staged repository](https://git.k8s.io/kubernetes/staging#external-repository-staging-area) for Kubernetes**.
|
||||
> Contributions, including issues and pull requests, should be made to the main Kubernetes repository: [https://github.com/kubernetes/kubernetes](https://github.com/kubernetes/kubernetes).
|
||||
> This repository is read-only for importing, and not used for direct contributions.
|
||||
> See [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.
|
||||
|
||||
# kubelet
|
||||
|
||||
Implements [KEP 14 - Moving ComponentConfig API types to staging repos](https://git.k8s.io/enhancements/keps/sig-cluster-lifecycle/wgs/115-componentconfig/README.md#kubelet-changes)
|
||||
|
|
|
@ -20,6 +20,23 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ServiceAccountTokenCacheType is the type of cache key used for caching credentials returned by the plugin
|
||||
// when the service account token is used.
|
||||
type ServiceAccountTokenCacheType string
|
||||
|
||||
const (
|
||||
// TokenServiceAccountTokenCacheType means the kubelet will cache returned credentials
|
||||
// on a per-token basis. This should be set if the returned credential's lifetime is limited
|
||||
// to the input service account token's lifetime.
|
||||
// For example, this must be used when returning the input service account token directly as a pull credential.
|
||||
TokenServiceAccountTokenCacheType ServiceAccountTokenCacheType = "Token"
|
||||
// ServiceAccountServiceAccountTokenCacheType means the kubelet will cache returned credentials
|
||||
// on a per-serviceaccount basis. This should be set if the plugin's credential retrieval logic
|
||||
// depends only on the service account and not on pod-specific claims.
|
||||
// Use this when the returned credential is valid for all pods using the same service account.
|
||||
ServiceAccountServiceAccountTokenCacheType ServiceAccountTokenCacheType = "ServiceAccount"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// CredentialProviderConfig is the configuration containing information about
|
||||
|
@ -117,6 +134,17 @@ type ServiceAccountTokenAttributes struct {
|
|||
// +required
|
||||
ServiceAccountTokenAudience string `json:"serviceAccountTokenAudience"`
|
||||
|
||||
// cacheType indicates the type of cache key use for caching the credentials returned by the plugin
|
||||
// when the service account token is used.
|
||||
// The most conservative option is to set this to "Token", which means the kubelet will cache returned credentials
|
||||
// on a per-token basis. This should be set if the returned credential's lifetime is limited to the service account
|
||||
// token's lifetime.
|
||||
// If the plugin's credential retrieval logic depends only on the service account and not on pod-specific claims,
|
||||
// then the plugin can set this to "ServiceAccount". In this case, the kubelet will cache returned credentials
|
||||
// on a per-serviceaccount basis. Use this when the returned credential is valid for all pods using the same service account.
|
||||
// +required
|
||||
CacheType ServiceAccountTokenCacheType `json:"cacheType"`
|
||||
|
||||
// requireServiceAccount indicates whether the plugin requires the pod to have a service account.
|
||||
// If set to true, kubelet will only invoke the plugin if the pod has a service account.
|
||||
// If set to false, kubelet will invoke the plugin even if the pod does not have a service account
|
||||
|
|
|
@ -149,6 +149,12 @@ type ImagePullCredentials struct {
|
|||
// +listType=set
|
||||
KubernetesSecrets []ImagePullSecret `json:"kubernetesSecrets"`
|
||||
|
||||
// KubernetesServiceAccounts is an index of coordinates of all the kubernetes
|
||||
// service accounts that were used to pull the image.
|
||||
// +optional
|
||||
// +listType=set
|
||||
KubernetesServiceAccounts []ImagePullServiceAccount `json:"kubernetesServiceAccounts,omitempty"`
|
||||
|
||||
// NodePodsAccessible is a flag denoting the pull credentials are accessible
|
||||
// by all the pods on the node, or that no credentials are needed for the pull.
|
||||
//
|
||||
|
@ -168,3 +174,11 @@ type ImagePullSecret struct {
|
|||
// content of the secret specified by the UID/Namespace/Name coordinates.
|
||||
CredentialHash string `json:"credentialHash"`
|
||||
}
|
||||
|
||||
// ImagePullServiceAccount is a representation of a Kubernetes service account object coordinates
|
||||
// for which the kubelet sent service account token to the credential provider plugin for image pull credentials.
|
||||
type ImagePullServiceAccount struct {
|
||||
UID string `json:"uid"`
|
||||
Namespace string `json:"namespace"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
|
|
@ -118,6 +118,11 @@ func (in *ImagePullCredentials) DeepCopyInto(out *ImagePullCredentials) {
|
|||
*out = make([]ImagePullSecret, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.KubernetesServiceAccounts != nil {
|
||||
in, out := &in.KubernetesServiceAccounts, &out.KubernetesServiceAccounts
|
||||
*out = make([]ImagePullServiceAccount, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -172,6 +177,22 @@ func (in *ImagePullSecret) DeepCopy() *ImagePullSecret {
|
|||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImagePullServiceAccount) DeepCopyInto(out *ImagePullServiceAccount) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImagePullServiceAccount.
|
||||
func (in *ImagePullServiceAccount) DeepCopy() *ImagePullServiceAccount {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ImagePullServiceAccount)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImagePulledRecord) DeepCopyInto(out *ImagePulledRecord) {
|
||||
*out = *in
|
||||
|
|
|
@ -301,6 +301,7 @@ type KubeletConfiguration struct {
|
|||
ClusterDNS []string `json:"clusterDNS,omitempty"`
|
||||
// streamingConnectionIdleTimeout is the maximum time a streaming connection
|
||||
// can be idle before the connection is automatically closed.
|
||||
// Deprecated: no longer has any effect.
|
||||
// Default: "4h"
|
||||
// +optional
|
||||
StreamingConnectionIdleTimeout metav1.Duration `json:"streamingConnectionIdleTimeout,omitempty"`
|
||||
|
@ -887,7 +888,6 @@ type KubeletConfiguration struct {
|
|||
// Tracing specifies the versioned configuration for OpenTelemetry tracing clients.
|
||||
// See https://kep.k8s.io/2832 for more details.
|
||||
// Default: nil
|
||||
// +featureGate=KubeletTracing
|
||||
// +optional
|
||||
Tracing *tracingapi.TracingConfiguration `json:"tracing,omitempty"`
|
||||
|
||||
|
|
25
go.mod
25
go.mod
|
@ -7,17 +7,18 @@ go 1.24.0
|
|||
godebug default=go1.24
|
||||
|
||||
require (
|
||||
github.com/emicklei/go-restful/v3 v3.11.0
|
||||
github.com/emicklei/go-restful/v3 v3.12.2
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/stretchr/testify v1.10.0
|
||||
go.uber.org/goleak v1.3.0
|
||||
google.golang.org/grpc v1.72.1
|
||||
k8s.io/api v0.0.0-20250612195650-7efafe3627c8
|
||||
k8s.io/apimachinery v0.0.0-20250612195403-e0270fe44c97
|
||||
k8s.io/apiserver v0.0.0-20250612202325-89f1e0c9f7d8
|
||||
k8s.io/client-go v0.0.0-20250612200049-4e82e684120e
|
||||
k8s.io/component-base v0.0.0-20250612201519-d0c00e6471f7
|
||||
k8s.io/cri-api v0.0.0-20250527182550-7d025a3cd8e3
|
||||
google.golang.org/protobuf v1.36.5
|
||||
k8s.io/api v0.0.0-20250816062245-fa01e40890d0
|
||||
k8s.io/apimachinery v0.0.0-20250816040907-f5dd29d6ada1
|
||||
k8s.io/apiserver v0.0.0-20250816065047-dbf8da530473
|
||||
k8s.io/client-go v0.0.0-20250816062719-0341f077c9d6
|
||||
k8s.io/component-base v0.0.0-20250816064138-bbf5f29946df
|
||||
k8s.io/cri-api v0.0.0-20250816040907-d8fa91b761d1
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
|
||||
)
|
||||
|
@ -27,7 +28,7 @@ require (
|
|||
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
|
||||
github.com/go-logr/logr v1.4.2 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
|
||||
|
@ -48,6 +49,7 @@ require (
|
|||
github.com/x448/float16 v0.8.4 // indirect
|
||||
go.opentelemetry.io/otel v1.35.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.35.0 // indirect
|
||||
go.yaml.in/yaml/v2 v2.4.2 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/oauth2 v0.27.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
|
@ -55,11 +57,10 @@ require (
|
|||
golang.org/x/text v0.23.0 // indirect
|
||||
golang.org/x/time v0.9.0 // indirect
|
||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
|
||||
google.golang.org/protobuf v1.36.5 // indirect
|
||||
gopkg.in/inf.v0 v0.9.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
|
||||
sigs.k8s.io/randfill v1.0.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
|
||||
sigs.k8s.io/yaml v1.4.0 // indirect
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
|
||||
sigs.k8s.io/yaml v1.6.0 // indirect
|
||||
)
|
||||
|
|
58
go.sum
58
go.sum
|
@ -10,10 +10,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6N
|
|||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g=
|
||||
github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU=
|
||||
github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/emicklei/go-restful/v3 v3.12.2 h1:DhwDP0vY3k8ZzE0RunuJy8GhNpPL6zqLkDf9B/a0/xU=
|
||||
github.com/emicklei/go-restful/v3 v3.12.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
|
||||
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
|
||||
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
|
@ -28,9 +28,8 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
|||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/google/gnostic-models v0.6.9 h1:MU/8wDLif2qCXZmzncUQ/BOfxWfthHi63KqpoNbWqVw=
|
||||
github.com/google/gnostic-models v0.6.9/go.mod h1:CiWsm0s6BSQd1hRn8/QmxqB6BesYcbSZxsz9b0KuDBw=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/gnostic-models v0.7.0 h1:qwTtogB15McXDaNqTZdzPJRHvaVJlAl+HVQnLmJEJxo=
|
||||
github.com/google/gnostic-models v0.7.0/go.mod h1:whL5G0m6dmc5cPxKc5bdKdEN3UjI7OUGxBlw57miDrQ=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
|
@ -111,6 +110,10 @@ go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt
|
|||
go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc=
|
||||
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
|
||||
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
|
||||
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
|
||||
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
|
||||
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
|
||||
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
|
@ -163,30 +166,29 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
|||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
k8s.io/api v0.0.0-20250612195650-7efafe3627c8 h1:K1AnJQBQTKLy2C/up2YSFuuQ+OBucYGcDCBO2cafjlQ=
|
||||
k8s.io/api v0.0.0-20250612195650-7efafe3627c8/go.mod h1:+9QbMyXTXctHAXg3fdhJbuZgyzhYgprCn43M5NqoJzw=
|
||||
k8s.io/apimachinery v0.0.0-20250612195403-e0270fe44c97 h1:h2og30eGCCk1GOEZK6+LNhhlydDcWY3wJaWDIs05xR8=
|
||||
k8s.io/apimachinery v0.0.0-20250612195403-e0270fe44c97/go.mod h1:EZ7eIfFAwky7ktmG4Pu9XWxBxFG++4dxPDOM0GL3abw=
|
||||
k8s.io/apiserver v0.0.0-20250612202325-89f1e0c9f7d8 h1:ParTrAI+8gMCqiYjD9B33XZxNnODITRKi0I/rJCJmTY=
|
||||
k8s.io/apiserver v0.0.0-20250612202325-89f1e0c9f7d8/go.mod h1:h9Mz8g41T/MRlrcxnfKoj9omNrKtKvdaDRhX34SVi5A=
|
||||
k8s.io/client-go v0.0.0-20250612200049-4e82e684120e h1:xoSxEgTvcAD7YG46B6RN1yZx5KhF0YKNe4SSoY+qSQA=
|
||||
k8s.io/client-go v0.0.0-20250612200049-4e82e684120e/go.mod h1:hktzpPyrdfB1WrXOvdnDayNSrngzEwWjiwTGqq6Zjns=
|
||||
k8s.io/component-base v0.0.0-20250612201519-d0c00e6471f7 h1:PmR3IJeL8qbnqdH70lmCLxZjHFr+Cbz5v6VY6ZFlMsI=
|
||||
k8s.io/component-base v0.0.0-20250612201519-d0c00e6471f7/go.mod h1:eMJvxKozNu3AbHhH6mWUJbzNhElacCbAilLeMjxIW5k=
|
||||
k8s.io/cri-api v0.0.0-20250527182550-7d025a3cd8e3 h1:r4SV0gc6fVMJPOUEhuyAt8FG1RD4iSzEQQtuztQDA9o=
|
||||
k8s.io/cri-api v0.0.0-20250527182550-7d025a3cd8e3/go.mod h1:+Caj3ZVbxtl8aq+J8bhiQCeDcYPYBFE1IFInuxO3fLk=
|
||||
k8s.io/api v0.0.0-20250816062245-fa01e40890d0 h1:WddRlAJwdWiTmGknuGqNHLxJ7RaF3bqjd933VhVCUes=
|
||||
k8s.io/api v0.0.0-20250816062245-fa01e40890d0/go.mod h1:PyEssxRzobRLFX/lEYzx5NDkS4JYE20SOKUZjTH0nvI=
|
||||
k8s.io/apimachinery v0.0.0-20250816040907-f5dd29d6ada1 h1:CyDLPRX8n0wju2WX8Bukq22Ucjz/XiXuS9WQvm/JBBI=
|
||||
k8s.io/apimachinery v0.0.0-20250816040907-f5dd29d6ada1/go.mod h1:/GwIlEcWuTX9zKIg2mbw0LRFIsXwrfoVxn+ef0X13lw=
|
||||
k8s.io/apiserver v0.0.0-20250816065047-dbf8da530473 h1:Fmygzv3VSpDzs9uD828iJF9UMLKoZUmOHJK3CkJUu6Q=
|
||||
k8s.io/apiserver v0.0.0-20250816065047-dbf8da530473/go.mod h1:jJ1HN4uExyqZ1IAgn3rRcIRJ+a9sCfSV9fEUoGC8HV4=
|
||||
k8s.io/client-go v0.0.0-20250816062719-0341f077c9d6 h1:9LKKgpQKzMGFGHGTjKbbNdW7beOdDbMZNTkEXWRSbPs=
|
||||
k8s.io/client-go v0.0.0-20250816062719-0341f077c9d6/go.mod h1:7VxAeZExKZSEiiIaKgN5fzCEcBAeEk7K42u7LqPTESo=
|
||||
k8s.io/component-base v0.0.0-20250816064138-bbf5f29946df h1:sJe8s1VNOpaiyhfYzHjB7Ji3HdrgqCNBz3DGYoTm9kY=
|
||||
k8s.io/component-base v0.0.0-20250816064138-bbf5f29946df/go.mod h1:0QeGK6CVamDGXq+dvJFxmoGxkPuM2mdaiQCtCjGAuaY=
|
||||
k8s.io/cri-api v0.0.0-20250816040907-d8fa91b761d1 h1:URYvn3H8kTQsxkJBO1GLWwptFD0+s1kfnFJJS8gbKmM=
|
||||
k8s.io/cri-api v0.0.0-20250816040907-d8fa91b761d1/go.mod h1:4qVUjidMg7/Z9YGZpqIDygbkPWkg3mkS1PvOx/kpHTE=
|
||||
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
|
||||
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff h1:/usPimJzUKKu+m+TE36gUyGcf03XZEP0ZIKgKj35LS4=
|
||||
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff/go.mod h1:5jIi+8yX4RIb8wk3XwBo5Pq2ccx4FP10ohkbSKCZoK8=
|
||||
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOPolHyvO06MXG5TUIj2mNAA=
|
||||
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts=
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 h1:hwvWFiBzdWw1FhfY1FooPn3kzWuJ8tmbZBHi4zVsl1Y=
|
||||
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
|
||||
sigs.k8s.io/randfill v0.0.0-20250304075658-069ef1bbf016/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE=
|
||||
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
|
||||
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
|
||||
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 h1:qPeWmscJcXP0snki5IYF79Z8xrl8ETFxgMd7wez1XkI=
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.7.0/go.mod h1:dDy58f92j70zLsuZVuUX5Wp9vtxXpaZnkPGWeqDfCps=
|
||||
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
||||
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
|
||||
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
|
||||
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
|
||||
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
# Disable inheritance as this is an api owners file
|
||||
options:
|
||||
no_parent_owners: true
|
||||
approvers:
|
||||
- api-approvers
|
||||
labels:
|
||||
- area/kubelet
|
||||
- sig/node
|
|
@ -1,10 +1,5 @@
|
|||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
# Disable inheritance as this is an api owners file
|
||||
options:
|
||||
no_parent_owners: true
|
||||
approvers:
|
||||
- api-approvers
|
||||
reviewers:
|
||||
- sig-node-api-reviewers
|
||||
- sig-auth-api-reviewers
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,17 +4,6 @@ syntax = "proto3";
|
|||
package deviceplugin; // This should have been v1alpha.
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/deviceplugin/v1alpha";
|
||||
|
||||
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
|
||||
|
|
|
@ -0,0 +1,313 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1alpha/api.proto
|
||||
|
||||
package v1alpha
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Registration_Register_FullMethodName = "/deviceplugin.Registration/Register"
|
||||
)
|
||||
|
||||
// RegistrationClient is the client API for Registration service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// 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
|
||||
type RegistrationClient interface {
|
||||
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
}
|
||||
|
||||
type registrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRegistrationClient(cc grpc.ClientConnInterface) RegistrationClient {
|
||||
return ®istrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *registrationClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Registration_Register_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RegistrationServer is the server API for Registration service.
|
||||
// All implementations must embed UnimplementedRegistrationServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 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
|
||||
type RegistrationServer interface {
|
||||
Register(context.Context, *RegisterRequest) (*Empty, error)
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedRegistrationServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedRegistrationServer) Register(context.Context, *RegisterRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) mustEmbedUnimplementedRegistrationServer() {}
|
||||
func (UnimplementedRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRegistrationServer interface {
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterRegistrationServer(s grpc.ServiceRegistrar, srv RegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRegistrationServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Registration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Registration_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).Register(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_Register_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).Register(ctx, req.(*RegisterRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Registration_ServiceDesc is the grpc.ServiceDesc for Registration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Registration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "deviceplugin.Registration",
|
||||
HandlerType: (*RegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Register",
|
||||
Handler: _Registration_Register_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1alpha/api.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
DevicePlugin_ListAndWatch_FullMethodName = "/deviceplugin.DevicePlugin/ListAndWatch"
|
||||
DevicePlugin_Allocate_FullMethodName = "/deviceplugin.DevicePlugin/Allocate"
|
||||
)
|
||||
|
||||
// DevicePluginClient is the client API for DevicePlugin service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// DevicePlugin is the service advertised by Device Plugins
|
||||
type DevicePluginClient interface {
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state changes or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListAndWatchResponse], error)
|
||||
// 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
|
||||
Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
|
||||
}
|
||||
|
||||
type devicePluginClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDevicePluginClient(cc grpc.ClientConnInterface) DevicePluginClient {
|
||||
return &devicePluginClient{cc}
|
||||
}
|
||||
|
||||
func (c *devicePluginClient) ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListAndWatchResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &DevicePlugin_ServiceDesc.Streams[0], DevicePlugin_ListAndWatch_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[Empty, ListAndWatchResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DevicePlugin_ListAndWatchClient = grpc.ServerStreamingClient[ListAndWatchResponse]
|
||||
|
||||
func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AllocateResponse)
|
||||
err := c.cc.Invoke(ctx, DevicePlugin_Allocate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DevicePluginServer is the server API for DevicePlugin service.
|
||||
// All implementations must embed UnimplementedDevicePluginServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// DevicePlugin is the service advertised by Device Plugins
|
||||
type DevicePluginServer interface {
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state changes or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
ListAndWatch(*Empty, grpc.ServerStreamingServer[ListAndWatchResponse]) error
|
||||
// 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
|
||||
Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
|
||||
mustEmbedUnimplementedDevicePluginServer()
|
||||
}
|
||||
|
||||
// UnimplementedDevicePluginServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDevicePluginServer struct{}
|
||||
|
||||
func (UnimplementedDevicePluginServer) ListAndWatch(*Empty, grpc.ServerStreamingServer[ListAndWatchResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method ListAndWatch not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) mustEmbedUnimplementedDevicePluginServer() {}
|
||||
func (UnimplementedDevicePluginServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDevicePluginServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DevicePluginServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDevicePluginServer interface {
|
||||
mustEmbedUnimplementedDevicePluginServer()
|
||||
}
|
||||
|
||||
func RegisterDevicePluginServer(s grpc.ServiceRegistrar, srv DevicePluginServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDevicePluginServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&DevicePlugin_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DevicePlugin_ListAndWatch_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(Empty)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(DevicePluginServer).ListAndWatch(m, &grpc.GenericServerStream[Empty, ListAndWatchResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DevicePlugin_ListAndWatchServer = grpc.ServerStreamingServer[ListAndWatchResponse]
|
||||
|
||||
func _DevicePlugin_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AllocateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DevicePluginServer).Allocate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DevicePlugin_Allocate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DevicePluginServer).Allocate(ctx, req.(*AllocateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// DevicePlugin_ServiceDesc is the grpc.ServiceDesc for DevicePlugin service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DevicePlugin_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "deviceplugin.DevicePlugin",
|
||||
HandlerType: (*DevicePluginServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Allocate",
|
||||
Handler: _DevicePlugin_Allocate_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "ListAndWatch",
|
||||
Handler: _DevicePlugin_ListAndWatch_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1alpha/api.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,17 +4,6 @@ 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
|
||||
|
@ -115,7 +104,7 @@ message Device {
|
|||
// - PreStartContainer allows Device Plugin to run device specific operations on
|
||||
// the Devices requested
|
||||
message PreStartContainerRequest {
|
||||
repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"];
|
||||
repeated string devices_ids = 1;
|
||||
}
|
||||
|
||||
// PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest
|
||||
|
@ -161,7 +150,7 @@ message AllocateRequest {
|
|||
}
|
||||
|
||||
message ContainerAllocateRequest {
|
||||
repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"];
|
||||
repeated string devices_ids = 1;
|
||||
}
|
||||
|
||||
// CDIDevice specifies a CDI device information.
|
||||
|
@ -195,7 +184,7 @@ message ContainerAllocateResponse {
|
|||
// 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"];
|
||||
repeated CDIDevice cdi_devices = 5;
|
||||
}
|
||||
|
||||
// Mount specifies a host volume to mount into a container.
|
||||
|
|
|
@ -0,0 +1,447 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Registration_Register_FullMethodName = "/v1beta1.Registration/Register"
|
||||
)
|
||||
|
||||
// RegistrationClient is the client API for Registration service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// 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
|
||||
type RegistrationClient interface {
|
||||
Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error)
|
||||
}
|
||||
|
||||
type registrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRegistrationClient(cc grpc.ClientConnInterface) RegistrationClient {
|
||||
return ®istrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *registrationClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, Registration_Register_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RegistrationServer is the server API for Registration service.
|
||||
// All implementations must embed UnimplementedRegistrationServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// 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
|
||||
type RegistrationServer interface {
|
||||
Register(context.Context, *RegisterRequest) (*Empty, error)
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedRegistrationServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedRegistrationServer) Register(context.Context, *RegisterRequest) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) mustEmbedUnimplementedRegistrationServer() {}
|
||||
func (UnimplementedRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRegistrationServer interface {
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterRegistrationServer(s grpc.ServiceRegistrar, srv RegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRegistrationServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Registration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Registration_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegisterRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).Register(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_Register_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).Register(ctx, req.(*RegisterRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Registration_ServiceDesc is the grpc.ServiceDesc for Registration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Registration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1beta1.Registration",
|
||||
HandlerType: (*RegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Register",
|
||||
Handler: _Registration_Register_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto",
|
||||
}
|
||||
|
||||
const (
|
||||
DevicePlugin_GetDevicePluginOptions_FullMethodName = "/v1beta1.DevicePlugin/GetDevicePluginOptions"
|
||||
DevicePlugin_ListAndWatch_FullMethodName = "/v1beta1.DevicePlugin/ListAndWatch"
|
||||
DevicePlugin_GetPreferredAllocation_FullMethodName = "/v1beta1.DevicePlugin/GetPreferredAllocation"
|
||||
DevicePlugin_Allocate_FullMethodName = "/v1beta1.DevicePlugin/Allocate"
|
||||
DevicePlugin_PreStartContainer_FullMethodName = "/v1beta1.DevicePlugin/PreStartContainer"
|
||||
)
|
||||
|
||||
// DevicePluginClient is the client API for DevicePlugin service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// DevicePlugin is the service advertised by Device Plugins
|
||||
type DevicePluginClient interface {
|
||||
// GetDevicePluginOptions returns options to be communicated with Device
|
||||
// Manager
|
||||
GetDevicePluginOptions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DevicePluginOptions, error)
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state change or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListAndWatchResponse], error)
|
||||
// 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.
|
||||
GetPreferredAllocation(ctx context.Context, in *PreferredAllocationRequest, opts ...grpc.CallOption) (*PreferredAllocationResponse, error)
|
||||
// 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
|
||||
Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error)
|
||||
// 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
|
||||
PreStartContainer(ctx context.Context, in *PreStartContainerRequest, opts ...grpc.CallOption) (*PreStartContainerResponse, error)
|
||||
}
|
||||
|
||||
type devicePluginClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDevicePluginClient(cc grpc.ClientConnInterface) DevicePluginClient {
|
||||
return &devicePluginClient{cc}
|
||||
}
|
||||
|
||||
func (c *devicePluginClient) GetDevicePluginOptions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DevicePluginOptions, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DevicePluginOptions)
|
||||
err := c.cc.Invoke(ctx, DevicePlugin_GetDevicePluginOptions_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *devicePluginClient) ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ListAndWatchResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &DevicePlugin_ServiceDesc.Streams[0], DevicePlugin_ListAndWatch_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[Empty, ListAndWatchResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DevicePlugin_ListAndWatchClient = grpc.ServerStreamingClient[ListAndWatchResponse]
|
||||
|
||||
func (c *devicePluginClient) GetPreferredAllocation(ctx context.Context, in *PreferredAllocationRequest, opts ...grpc.CallOption) (*PreferredAllocationResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PreferredAllocationResponse)
|
||||
err := c.cc.Invoke(ctx, DevicePlugin_GetPreferredAllocation_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AllocateResponse)
|
||||
err := c.cc.Invoke(ctx, DevicePlugin_Allocate_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *devicePluginClient) PreStartContainer(ctx context.Context, in *PreStartContainerRequest, opts ...grpc.CallOption) (*PreStartContainerResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PreStartContainerResponse)
|
||||
err := c.cc.Invoke(ctx, DevicePlugin_PreStartContainer_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DevicePluginServer is the server API for DevicePlugin service.
|
||||
// All implementations must embed UnimplementedDevicePluginServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// DevicePlugin is the service advertised by Device Plugins
|
||||
type DevicePluginServer interface {
|
||||
// GetDevicePluginOptions returns options to be communicated with Device
|
||||
// Manager
|
||||
GetDevicePluginOptions(context.Context, *Empty) (*DevicePluginOptions, error)
|
||||
// ListAndWatch returns a stream of List of Devices
|
||||
// Whenever a Device state change or a Device disappears, ListAndWatch
|
||||
// returns the new list
|
||||
ListAndWatch(*Empty, grpc.ServerStreamingServer[ListAndWatchResponse]) error
|
||||
// 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.
|
||||
GetPreferredAllocation(context.Context, *PreferredAllocationRequest) (*PreferredAllocationResponse, error)
|
||||
// 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
|
||||
Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error)
|
||||
// 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
|
||||
PreStartContainer(context.Context, *PreStartContainerRequest) (*PreStartContainerResponse, error)
|
||||
mustEmbedUnimplementedDevicePluginServer()
|
||||
}
|
||||
|
||||
// UnimplementedDevicePluginServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDevicePluginServer struct{}
|
||||
|
||||
func (UnimplementedDevicePluginServer) GetDevicePluginOptions(context.Context, *Empty) (*DevicePluginOptions, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetDevicePluginOptions not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) ListAndWatch(*Empty, grpc.ServerStreamingServer[ListAndWatchResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method ListAndWatch not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) GetPreferredAllocation(context.Context, *PreferredAllocationRequest) (*PreferredAllocationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPreferredAllocation not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) Allocate(context.Context, *AllocateRequest) (*AllocateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) PreStartContainer(context.Context, *PreStartContainerRequest) (*PreStartContainerResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PreStartContainer not implemented")
|
||||
}
|
||||
func (UnimplementedDevicePluginServer) mustEmbedUnimplementedDevicePluginServer() {}
|
||||
func (UnimplementedDevicePluginServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDevicePluginServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DevicePluginServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDevicePluginServer interface {
|
||||
mustEmbedUnimplementedDevicePluginServer()
|
||||
}
|
||||
|
||||
func RegisterDevicePluginServer(s grpc.ServiceRegistrar, srv DevicePluginServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDevicePluginServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&DevicePlugin_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DevicePlugin_GetDevicePluginOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DevicePluginServer).GetDevicePluginOptions(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DevicePlugin_GetDevicePluginOptions_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DevicePluginServer).GetDevicePluginOptions(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DevicePlugin_ListAndWatch_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(Empty)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(DevicePluginServer).ListAndWatch(m, &grpc.GenericServerStream[Empty, ListAndWatchResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DevicePlugin_ListAndWatchServer = grpc.ServerStreamingServer[ListAndWatchResponse]
|
||||
|
||||
func _DevicePlugin_GetPreferredAllocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PreferredAllocationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DevicePluginServer).GetPreferredAllocation(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DevicePlugin_GetPreferredAllocation_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DevicePluginServer).GetPreferredAllocation(ctx, req.(*PreferredAllocationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DevicePlugin_Allocate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AllocateRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DevicePluginServer).Allocate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DevicePlugin_Allocate_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DevicePluginServer).Allocate(ctx, req.(*AllocateRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DevicePlugin_PreStartContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PreStartContainerRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DevicePluginServer).PreStartContainer(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: DevicePlugin_PreStartContainer_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DevicePluginServer).PreStartContainer(ctx, req.(*PreStartContainerRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// DevicePlugin_ServiceDesc is the grpc.ServiceDesc for DevicePlugin service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DevicePlugin_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1beta1.DevicePlugin",
|
||||
HandlerType: (*DevicePluginServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetDevicePluginOptions",
|
||||
Handler: _DevicePlugin_GetDevicePluginOptions_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPreferredAllocation",
|
||||
Handler: _DevicePlugin_GetPreferredAllocation_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Allocate",
|
||||
Handler: _DevicePlugin_Allocate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "PreStartContainer",
|
||||
Handler: _DevicePlugin_PreStartContainer_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "ListAndWatch",
|
||||
Handler: _DevicePlugin_ListAndWatch_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1/api.proto",
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
labels:
|
||||
- sig/node
|
||||
- wg/device-management
|
|
@ -0,0 +1,414 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// Copyright 2025 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 protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.36.4
|
||||
// protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/dra-health/v1alpha1/api.proto
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// HealthStatus defines the possible health states of a device.
|
||||
type HealthStatus int32
|
||||
|
||||
const (
|
||||
// UNKNOWN indicates that the health of the device cannot be determined.
|
||||
HealthStatus_UNKNOWN HealthStatus = 0
|
||||
// HEALTHY indicates that the device is operating normally.
|
||||
HealthStatus_HEALTHY HealthStatus = 1
|
||||
// UNHEALTHY indicates that the device has reported a problem.
|
||||
HealthStatus_UNHEALTHY HealthStatus = 2
|
||||
)
|
||||
|
||||
// Enum value maps for HealthStatus.
|
||||
var (
|
||||
HealthStatus_name = map[int32]string{
|
||||
0: "UNKNOWN",
|
||||
1: "HEALTHY",
|
||||
2: "UNHEALTHY",
|
||||
}
|
||||
HealthStatus_value = map[string]int32{
|
||||
"UNKNOWN": 0,
|
||||
"HEALTHY": 1,
|
||||
"UNHEALTHY": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x HealthStatus) Enum() *HealthStatus {
|
||||
p := new(HealthStatus)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x HealthStatus) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (HealthStatus) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (HealthStatus) Type() protoreflect.EnumType {
|
||||
return &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x HealthStatus) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HealthStatus.Descriptor instead.
|
||||
func (HealthStatus) EnumDescriptor() ([]byte, []int) {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type NodeWatchResourcesRequest struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NodeWatchResourcesRequest) Reset() {
|
||||
*x = NodeWatchResourcesRequest{}
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NodeWatchResourcesRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodeWatchResourcesRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NodeWatchResourcesRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodeWatchResourcesRequest.ProtoReflect.Descriptor instead.
|
||||
func (*NodeWatchResourcesRequest) Descriptor() ([]byte, []int) {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// DeviceIdentifier uniquely identifies a device within the scope of a driver.
|
||||
type DeviceIdentifier struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// The pool which contains the device.
|
||||
PoolName string `protobuf:"bytes,1,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"`
|
||||
// The unique name of the device within the pool.
|
||||
DeviceName string `protobuf:"bytes,2,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeviceIdentifier) Reset() {
|
||||
*x = DeviceIdentifier{}
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeviceIdentifier) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeviceIdentifier) ProtoMessage() {}
|
||||
|
||||
func (x *DeviceIdentifier) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeviceIdentifier.ProtoReflect.Descriptor instead.
|
||||
func (*DeviceIdentifier) Descriptor() ([]byte, []int) {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *DeviceIdentifier) GetPoolName() string {
|
||||
if x != nil {
|
||||
return x.PoolName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *DeviceIdentifier) GetDeviceName() string {
|
||||
if x != nil {
|
||||
return x.DeviceName
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// DeviceHealth represents the health of a single device.
|
||||
type DeviceHealth struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
// The identifier for the device.
|
||||
Device *DeviceIdentifier `protobuf:"bytes,1,opt,name=device,proto3" json:"device,omitempty"`
|
||||
// The health status of the device.
|
||||
Health HealthStatus `protobuf:"varint,2,opt,name=health,proto3,enum=v1alpha1.HealthStatus" json:"health,omitempty"`
|
||||
// The Unix time (in seconds) of when this health status was last determined by the plugin.
|
||||
LastUpdatedTime int64 `protobuf:"varint,3,opt,name=last_updated_time,json=lastUpdatedTime,proto3" json:"last_updated_time,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *DeviceHealth) Reset() {
|
||||
*x = DeviceHealth{}
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *DeviceHealth) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*DeviceHealth) ProtoMessage() {}
|
||||
|
||||
func (x *DeviceHealth) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use DeviceHealth.ProtoReflect.Descriptor instead.
|
||||
func (*DeviceHealth) Descriptor() ([]byte, []int) {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *DeviceHealth) GetDevice() *DeviceIdentifier {
|
||||
if x != nil {
|
||||
return x.Device
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *DeviceHealth) GetHealth() HealthStatus {
|
||||
if x != nil {
|
||||
return x.Health
|
||||
}
|
||||
return HealthStatus_UNKNOWN
|
||||
}
|
||||
|
||||
func (x *DeviceHealth) GetLastUpdatedTime() int64 {
|
||||
if x != nil {
|
||||
return x.LastUpdatedTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// NodeWatchResourcesResponse contains a list of devices and their current health.
|
||||
// This should be a complete list for the driver; Kubelet will reconcile this
|
||||
// state with its internal cache. Any devices managed by the driver that are
|
||||
// not in this list will be considered to have an "Unknown" health status after a timeout.
|
||||
type NodeWatchResourcesResponse struct {
|
||||
state protoimpl.MessageState `protogen:"open.v1"`
|
||||
Devices []*DeviceHealth `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
|
||||
func (x *NodeWatchResourcesResponse) Reset() {
|
||||
*x = NodeWatchResourcesResponse{}
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NodeWatchResourcesResponse) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodeWatchResourcesResponse) ProtoMessage() {}
|
||||
|
||||
func (x *NodeWatchResourcesResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodeWatchResourcesResponse.ProtoReflect.Descriptor instead.
|
||||
func (*NodeWatchResourcesResponse) Descriptor() ([]byte, []int) {
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *NodeWatchResourcesResponse) GetDevices() []*DeviceHealth {
|
||||
if x != nil {
|
||||
return x.Devices
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDesc = string([]byte{
|
||||
0x0a, 0x41, 0x73, 0x74, 0x61, 0x67, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x72, 0x63, 0x2f, 0x6b, 0x38,
|
||||
0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x6b, 0x67,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x72, 0x61, 0x2d, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68,
|
||||
0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x1b, 0x0a,
|
||||
0x19, 0x4e, 0x6f, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x10, 0x44, 0x65,
|
||||
0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1b,
|
||||
0x0a, 0x09, 0x70, 0x6f, 0x6f, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x08, 0x70, 0x6f, 0x6f, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x64,
|
||||
0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x0a, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x9e, 0x01, 0x0a,
|
||||
0x0c, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x32, 0x0a,
|
||||
0x06, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49,
|
||||
0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x06, 0x64, 0x65, 0x76, 0x69, 0x63,
|
||||
0x65, 0x12, 0x2e, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0e, 0x32, 0x16, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61,
|
||||
0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x68, 0x65, 0x61, 0x6c, 0x74,
|
||||
0x68, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x6c, 0x61,
|
||||
0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x4e, 0x0a,
|
||||
0x1a, 0x4e, 0x6f, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x64,
|
||||
0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x76,
|
||||
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x48, 0x65,
|
||||
0x61, 0x6c, 0x74, 0x68, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2a, 0x37, 0x0a,
|
||||
0x0c, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a,
|
||||
0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x48, 0x45,
|
||||
0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x48, 0x45, 0x41,
|
||||
0x4c, 0x54, 0x48, 0x59, 0x10, 0x02, 0x32, 0x78, 0x0a, 0x11, 0x44, 0x52, 0x41, 0x52, 0x65, 0x73,
|
||||
0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x63, 0x0a, 0x12, 0x4e,
|
||||
0x6f, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x73, 0x12, 0x23, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x6f, 0x64,
|
||||
0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
|
||||
0x31, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x57, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75,
|
||||
0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01,
|
||||
0x42, 0x2d, 0x5a, 0x2b, 0x6b, 0x38, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x75, 0x62, 0x65, 0x6c,
|
||||
0x65, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x72, 0x61, 0x2d,
|
||||
0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
})
|
||||
|
||||
var (
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescOnce sync.Once
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescData []byte
|
||||
)
|
||||
|
||||
func file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescGZIP() []byte {
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescOnce.Do(func() {
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDesc), len(file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDesc)))
|
||||
})
|
||||
return file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_goTypes = []any{
|
||||
(HealthStatus)(0), // 0: v1alpha1.HealthStatus
|
||||
(*NodeWatchResourcesRequest)(nil), // 1: v1alpha1.NodeWatchResourcesRequest
|
||||
(*DeviceIdentifier)(nil), // 2: v1alpha1.DeviceIdentifier
|
||||
(*DeviceHealth)(nil), // 3: v1alpha1.DeviceHealth
|
||||
(*NodeWatchResourcesResponse)(nil), // 4: v1alpha1.NodeWatchResourcesResponse
|
||||
}
|
||||
var file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_depIdxs = []int32{
|
||||
2, // 0: v1alpha1.DeviceHealth.device:type_name -> v1alpha1.DeviceIdentifier
|
||||
0, // 1: v1alpha1.DeviceHealth.health:type_name -> v1alpha1.HealthStatus
|
||||
3, // 2: v1alpha1.NodeWatchResourcesResponse.devices:type_name -> v1alpha1.DeviceHealth
|
||||
1, // 3: v1alpha1.DRAResourceHealth.NodeWatchResources:input_type -> v1alpha1.NodeWatchResourcesRequest
|
||||
4, // 4: v1alpha1.DRAResourceHealth.NodeWatchResources:output_type -> v1alpha1.NodeWatchResourcesResponse
|
||||
4, // [4:5] is the sub-list for method output_type
|
||||
3, // [3:4] is the sub-list for method input_type
|
||||
3, // [3:3] is the sub-list for extension type_name
|
||||
3, // [3:3] is the sub-list for extension extendee
|
||||
0, // [0:3] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_init() }
|
||||
func file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_init() {
|
||||
if File_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: unsafe.Slice(unsafe.StringData(file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDesc), len(file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_rawDesc)),
|
||||
NumEnums: 1,
|
||||
NumMessages: 4,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_goTypes,
|
||||
DependencyIndexes: file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_depIdxs,
|
||||
EnumInfos: file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_enumTypes,
|
||||
MessageInfos: file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_msgTypes,
|
||||
}.Build()
|
||||
File_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto = out.File
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_goTypes = nil
|
||||
file_staging_src_k8s_io_kubelet_pkg_apis_dra_health_v1alpha1_api_proto_depIdxs = nil
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright 2025 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.
|
||||
|
||||
syntax = "proto3";
|
||||
package v1alpha1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/dra-health/v1alpha1";
|
||||
|
||||
|
||||
// DRAResourceHealth service is implemented by DRA plugins and called by Kubelet.
|
||||
service DRAResourceHealth {
|
||||
// NodeWatchResources allows a DRA plugin to stream health updates for its devices to Kubelet.
|
||||
rpc NodeWatchResources(NodeWatchResourcesRequest) returns (stream NodeWatchResourcesResponse) {}
|
||||
}
|
||||
|
||||
message NodeWatchResourcesRequest {
|
||||
// Reserved for future use.
|
||||
}
|
||||
|
||||
// HealthStatus defines the possible health states of a device.
|
||||
enum HealthStatus {
|
||||
// UNKNOWN indicates that the health of the device cannot be determined.
|
||||
UNKNOWN = 0;
|
||||
// HEALTHY indicates that the device is operating normally.
|
||||
HEALTHY = 1;
|
||||
// UNHEALTHY indicates that the device has reported a problem.
|
||||
UNHEALTHY = 2;
|
||||
}
|
||||
|
||||
// DeviceIdentifier uniquely identifies a device within the scope of a driver.
|
||||
message DeviceIdentifier {
|
||||
// The pool which contains the device.
|
||||
string pool_name = 1;
|
||||
|
||||
// The unique name of the device within the pool.
|
||||
string device_name = 2;
|
||||
}
|
||||
|
||||
// DeviceHealth represents the health of a single device.
|
||||
message DeviceHealth {
|
||||
// The identifier for the device.
|
||||
DeviceIdentifier device = 1;
|
||||
|
||||
// The health status of the device.
|
||||
HealthStatus health = 2;
|
||||
|
||||
// The Unix time (in seconds) of when this health status was last determined by the plugin.
|
||||
int64 last_updated_time = 3;
|
||||
}
|
||||
|
||||
// NodeWatchResourcesResponse contains a list of devices and their current health.
|
||||
// This should be a complete list for the driver; Kubelet will reconcile this
|
||||
// state with its internal cache. Any devices managed by the driver that are
|
||||
// not in this list will be considered to have an "Unknown" health status after a timeout.
|
||||
message NodeWatchResourcesResponse {
|
||||
repeated DeviceHealth devices = 1;
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// Copyright 2025 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 protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/dra-health/v1alpha1/api.proto
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
DRAResourceHealth_NodeWatchResources_FullMethodName = "/v1alpha1.DRAResourceHealth/NodeWatchResources"
|
||||
)
|
||||
|
||||
// DRAResourceHealthClient is the client API for DRAResourceHealth service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// DRAResourceHealth service is implemented by DRA plugins and called by Kubelet.
|
||||
type DRAResourceHealthClient interface {
|
||||
// NodeWatchResources allows a DRA plugin to stream health updates for its devices to Kubelet.
|
||||
NodeWatchResources(ctx context.Context, in *NodeWatchResourcesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NodeWatchResourcesResponse], error)
|
||||
}
|
||||
|
||||
type dRAResourceHealthClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDRAResourceHealthClient(cc grpc.ClientConnInterface) DRAResourceHealthClient {
|
||||
return &dRAResourceHealthClient{cc}
|
||||
}
|
||||
|
||||
func (c *dRAResourceHealthClient) NodeWatchResources(ctx context.Context, in *NodeWatchResourcesRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[NodeWatchResourcesResponse], error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
stream, err := c.cc.NewStream(ctx, &DRAResourceHealth_ServiceDesc.Streams[0], DRAResourceHealth_NodeWatchResources_FullMethodName, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &grpc.GenericClientStream[NodeWatchResourcesRequest, NodeWatchResourcesResponse]{ClientStream: stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DRAResourceHealth_NodeWatchResourcesClient = grpc.ServerStreamingClient[NodeWatchResourcesResponse]
|
||||
|
||||
// DRAResourceHealthServer is the server API for DRAResourceHealth service.
|
||||
// All implementations must embed UnimplementedDRAResourceHealthServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// DRAResourceHealth service is implemented by DRA plugins and called by Kubelet.
|
||||
type DRAResourceHealthServer interface {
|
||||
// NodeWatchResources allows a DRA plugin to stream health updates for its devices to Kubelet.
|
||||
NodeWatchResources(*NodeWatchResourcesRequest, grpc.ServerStreamingServer[NodeWatchResourcesResponse]) error
|
||||
mustEmbedUnimplementedDRAResourceHealthServer()
|
||||
}
|
||||
|
||||
// UnimplementedDRAResourceHealthServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDRAResourceHealthServer struct{}
|
||||
|
||||
func (UnimplementedDRAResourceHealthServer) NodeWatchResources(*NodeWatchResourcesRequest, grpc.ServerStreamingServer[NodeWatchResourcesResponse]) error {
|
||||
return status.Errorf(codes.Unimplemented, "method NodeWatchResources not implemented")
|
||||
}
|
||||
func (UnimplementedDRAResourceHealthServer) mustEmbedUnimplementedDRAResourceHealthServer() {}
|
||||
func (UnimplementedDRAResourceHealthServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeDRAResourceHealthServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DRAResourceHealthServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDRAResourceHealthServer interface {
|
||||
mustEmbedUnimplementedDRAResourceHealthServer()
|
||||
}
|
||||
|
||||
func RegisterDRAResourceHealthServer(s grpc.ServiceRegistrar, srv DRAResourceHealthServer) {
|
||||
// If the following call pancis, it indicates UnimplementedDRAResourceHealthServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&DRAResourceHealth_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _DRAResourceHealth_NodeWatchResources_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(NodeWatchResourcesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(DRAResourceHealthServer).NodeWatchResources(m, &grpc.GenericServerStream[NodeWatchResourcesRequest, NodeWatchResourcesResponse]{ServerStream: stream})
|
||||
}
|
||||
|
||||
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||||
type DRAResourceHealth_NodeWatchResourcesServer = grpc.ServerStreamingServer[NodeWatchResourcesResponse]
|
||||
|
||||
// DRAResourceHealth_ServiceDesc is the grpc.ServiceDesc for DRAResourceHealth service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var DRAResourceHealth_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1alpha1.DRAResourceHealth",
|
||||
HandlerType: (*DRAResourceHealthServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "NodeWatchResources",
|
||||
Handler: _DRAResourceHealth_NodeWatchResources_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/dra-health/v1alpha1/api.proto",
|
||||
}
|
|
@ -1,8 +1,5 @@
|
|||
# See the OWNERS docs at https://go.k8s.io/owners
|
||||
|
||||
approvers:
|
||||
- klueska
|
||||
- pohly
|
||||
reviewers:
|
||||
- klueska
|
||||
- pohly
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: api.proto
|
||||
|
||||
package v1alpha4
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
@ -326,7 +326,8 @@ func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim {
|
|||
type NodeUnprepareResourcesResponse struct {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
// apply. In particular, all claims in the request must
|
||||
// have an entry in the response, even if that entry is nil.
|
||||
Claims map[string]*NodeUnprepareResourceResponse `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
|
@ -485,58 +486,59 @@ func (m *Claim) GetName() string {
|
|||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*NodePrepareResourcesRequest)(nil), "v1alpha3.NodePrepareResourcesRequest")
|
||||
proto.RegisterType((*NodePrepareResourcesResponse)(nil), "v1alpha3.NodePrepareResourcesResponse")
|
||||
proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourcesResponse.ClaimsEntry")
|
||||
proto.RegisterType((*NodePrepareResourceResponse)(nil), "v1alpha3.NodePrepareResourceResponse")
|
||||
proto.RegisterType((*Device)(nil), "v1alpha3.Device")
|
||||
proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "v1alpha3.NodeUnprepareResourcesRequest")
|
||||
proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse")
|
||||
proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourcesResponse.ClaimsEntry")
|
||||
proto.RegisterType((*NodeUnprepareResourceResponse)(nil), "v1alpha3.NodeUnprepareResourceResponse")
|
||||
proto.RegisterType((*Claim)(nil), "v1alpha3.Claim")
|
||||
proto.RegisterType((*NodePrepareResourcesRequest)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodePrepareResourcesRequest")
|
||||
proto.RegisterType((*NodePrepareResourcesResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodePrepareResourcesResponse")
|
||||
proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodePrepareResourcesResponse.ClaimsEntry")
|
||||
proto.RegisterType((*NodePrepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodePrepareResourceResponse")
|
||||
proto.RegisterType((*Device)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.Device")
|
||||
proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodeUnprepareResourcesRequest")
|
||||
proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodeUnprepareResourcesResponse")
|
||||
proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodeUnprepareResourcesResponse.ClaimsEntry")
|
||||
proto.RegisterType((*NodeUnprepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.NodeUnprepareResourceResponse")
|
||||
proto.RegisterType((*Claim)(nil), "k8s.io.kubelet.pkg.apis.dra.v1.Claim")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
|
||||
|
||||
var fileDescriptor_00212fb1f9d3bf1c = []byte{
|
||||
// 566 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcb, 0x6e, 0xd3, 0x4c,
|
||||
0x14, 0xce, 0x34, 0x97, 0xd6, 0x27, 0xf9, 0x7f, 0xa2, 0x51, 0x85, 0x42, 0x5a, 0x9c, 0xc8, 0x50,
|
||||
0x12, 0x21, 0x11, 0x8b, 0xb4, 0xa0, 0x0a, 0xc4, 0x26, 0x0d, 0x88, 0x20, 0x54, 0x21, 0x8b, 0x6e,
|
||||
0xd8, 0x04, 0xc7, 0x1e, 0x52, 0x2b, 0x97, 0x19, 0x66, 0xe2, 0x48, 0xdd, 0xf1, 0x08, 0xbc, 0x03,
|
||||
0x2f, 0xd3, 0x05, 0x0b, 0xc4, 0x8a, 0x55, 0x44, 0xcd, 0x8b, 0x20, 0xcf, 0xd8, 0x49, 0x5a, 0x39,
|
||||
0x4d, 0x25, 0x76, 0x73, 0xbe, 0x73, 0xf9, 0xce, 0x9c, 0xef, 0xcc, 0x80, 0x66, 0x33, 0xaf, 0xc1,
|
||||
0x38, 0x9d, 0x50, 0xbc, 0x35, 0x7d, 0x6c, 0x0f, 0xd9, 0xa9, 0xbd, 0x5f, 0x7e, 0xd4, 0xf7, 0x26,
|
||||
0xa7, 0x7e, 0xaf, 0xe1, 0xd0, 0x91, 0xd9, 0xa7, 0x7d, 0x6a, 0xca, 0x80, 0x9e, 0xff, 0x49, 0x5a,
|
||||
0xd2, 0x90, 0x27, 0x95, 0x68, 0xbc, 0x82, 0x9d, 0x63, 0xea, 0x92, 0x77, 0x9c, 0x30, 0x9b, 0x13,
|
||||
0x8b, 0x08, 0xea, 0x73, 0x87, 0x08, 0x8b, 0x7c, 0xf6, 0x89, 0x98, 0xe0, 0x1a, 0xe4, 0x9c, 0xa1,
|
||||
0xed, 0x8d, 0x44, 0x09, 0x55, 0xd3, 0xf5, 0x7c, 0xf3, 0x56, 0x23, 0x26, 0x6a, 0x1c, 0x85, 0xb8,
|
||||
0x15, 0xb9, 0x8d, 0xef, 0x08, 0x76, 0x93, 0x0b, 0x09, 0x46, 0xc7, 0x82, 0xe0, 0x37, 0x57, 0x2a,
|
||||
0x35, 0x17, 0x95, 0xae, 0xcb, 0x53, 0x34, 0xe2, 0xe5, 0x78, 0xc2, 0xcf, 0x62, 0xb2, 0xf2, 0x47,
|
||||
0xc8, 0x2f, 0xc1, 0xb8, 0x08, 0xe9, 0x01, 0x39, 0x2b, 0xa1, 0x2a, 0xaa, 0x6b, 0x56, 0x78, 0xc4,
|
||||
0xcf, 0x21, 0x3b, 0xb5, 0x87, 0x3e, 0x29, 0x6d, 0x54, 0x51, 0x3d, 0xdf, 0xdc, 0xbb, 0x96, 0x2b,
|
||||
0xa6, 0xb2, 0x54, 0xce, 0xb3, 0x8d, 0x43, 0x64, 0x74, 0x13, 0xc7, 0x32, 0xbf, 0xcc, 0x43, 0xd8,
|
||||
0x74, 0xc9, 0xd4, 0x73, 0x48, 0x7c, 0x9b, 0xe2, 0x82, 0xa1, 0x2d, 0x1d, 0x56, 0x1c, 0x80, 0xb7,
|
||||
0x21, 0x4b, 0x38, 0xa7, 0x5c, 0xf6, 0xa2, 0x59, 0xca, 0x30, 0xbe, 0x21, 0xc8, 0xa9, 0x48, 0x7c,
|
||||
0x0f, 0xfe, 0xe3, 0x6a, 0xdc, 0xdd, 0xb1, 0x3d, 0x8a, 0x4a, 0x6a, 0x56, 0x21, 0x02, 0x8f, 0x43,
|
||||
0x0c, 0xef, 0x80, 0xc6, 0x28, 0x1d, 0xca, 0x88, 0xa8, 0xd2, 0x56, 0x08, 0x84, 0x5e, 0x5c, 0x81,
|
||||
0xbc, 0x62, 0x53, 0xee, 0xb4, 0x74, 0x83, 0x82, 0x64, 0xc0, 0x53, 0xf8, 0xdf, 0x71, 0xbd, 0x6e,
|
||||
0x14, 0xe4, 0xb9, 0xa2, 0x94, 0x09, 0x39, 0x5a, 0xc5, 0x60, 0x56, 0x29, 0x1c, 0xb5, 0x3b, 0xaa,
|
||||
0x93, 0x4e, 0x5b, 0x58, 0x05, 0xc7, 0xf5, 0x22, 0xcb, 0x15, 0xc6, 0x6b, 0xb8, 0x1b, 0x8e, 0xe1,
|
||||
0x64, 0xcc, 0xfe, 0x75, 0x3f, 0x7e, 0x22, 0xd0, 0x57, 0x95, 0x8a, 0x86, 0xfa, 0xf6, 0x4a, 0xad,
|
||||
0x83, 0xcb, 0xaa, 0xad, 0xce, 0x4c, 0xdc, 0x91, 0xde, 0xba, 0x1d, 0x79, 0x71, 0x79, 0x47, 0x6a,
|
||||
0x6b, 0xd8, 0x92, 0xb6, 0xe4, 0xc9, 0x8a, 0xf1, 0xcc, 0xaf, 0x34, 0xd7, 0x1e, 0x2d, 0x6b, 0xff,
|
||||
0x1e, 0xb2, 0xb2, 0x35, 0xbc, 0x0b, 0x9a, 0x54, 0x9c, 0xd9, 0x0e, 0x89, 0x42, 0x16, 0x00, 0xbe,
|
||||
0x03, 0x69, 0xdf, 0x73, 0x95, 0xd8, 0xad, 0xcd, 0x60, 0x56, 0x49, 0x9f, 0x74, 0xda, 0x56, 0x88,
|
||||
0x61, 0x0c, 0x99, 0x25, 0xa5, 0xe5, 0xb9, 0x39, 0x43, 0x90, 0x09, 0xbb, 0xc1, 0x7d, 0xd8, 0x4e,
|
||||
0x7a, 0x51, 0x78, 0x6f, 0xdd, 0x8b, 0x93, 0x92, 0x96, 0x1f, 0xdc, 0xec, 0x61, 0x1a, 0x29, 0x3c,
|
||||
0x82, 0xdb, 0xc9, 0xc2, 0xe0, 0xda, 0x7a, 0xe9, 0x14, 0x59, 0xfd, 0xa6, 0x1a, 0x1b, 0xa9, 0x56,
|
||||
0xeb, 0xfc, 0x42, 0x47, 0xbf, 0x2e, 0xf4, 0xd4, 0x97, 0x40, 0x47, 0xe7, 0x81, 0x8e, 0x7e, 0x04,
|
||||
0x3a, 0xfa, 0x1d, 0xe8, 0xe8, 0xeb, 0x1f, 0x3d, 0xf5, 0xe1, 0xfe, 0xe0, 0x50, 0x34, 0x3c, 0x6a,
|
||||
0x0e, 0xfc, 0x1e, 0x19, 0x92, 0x89, 0xc9, 0x06, 0x7d, 0xd3, 0x66, 0x9e, 0x30, 0x5d, 0x6e, 0x9b,
|
||||
0x11, 0xc9, 0x41, 0x2f, 0x27, 0x7f, 0xbd, 0xfd, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x91, 0xf3,
|
||||
0x7a, 0xa9, 0x3b, 0x05, 0x00, 0x00,
|
||||
// 589 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x6f, 0xd3, 0x30,
|
||||
0x1c, 0xad, 0xd7, 0xad, 0x23, 0xbf, 0x16, 0x34, 0x59, 0x13, 0x2a, 0xdd, 0x48, 0xab, 0x20, 0x50,
|
||||
0x2f, 0x24, 0x5a, 0x11, 0x68, 0x62, 0x2b, 0x82, 0xae, 0x48, 0x94, 0xc3, 0x34, 0x02, 0xbb, 0x20,
|
||||
0xc4, 0x48, 0x13, 0x13, 0xac, 0xfe, 0x71, 0xb0, 0x9b, 0x8a, 0xdd, 0xf8, 0x08, 0x48, 0x9c, 0x38,
|
||||
0xf3, 0x39, 0xb8, 0xef, 0xc8, 0x91, 0xd3, 0xc4, 0xc2, 0x97, 0xe0, 0x84, 0x50, 0xec, 0xb4, 0x94,
|
||||
0x29, 0x5d, 0x51, 0x27, 0x6e, 0xf6, 0xcf, 0xcf, 0xef, 0x3d, 0xfb, 0xf7, 0xe2, 0x80, 0xe6, 0x04,
|
||||
0xd4, 0x0c, 0x38, 0x1b, 0x30, 0xac, 0x77, 0x36, 0x85, 0x49, 0x99, 0xd9, 0x09, 0xdb, 0xa4, 0x4b,
|
||||
0x06, 0x66, 0xd0, 0xf1, 0x4d, 0x27, 0xa0, 0xc2, 0xf4, 0xb8, 0x63, 0x0e, 0x37, 0x4a, 0x37, 0x7d,
|
||||
0x3a, 0x78, 0x13, 0xb6, 0x4d, 0x97, 0xf5, 0x2c, 0x9f, 0xf9, 0xcc, 0x92, 0xdb, 0xda, 0xe1, 0x6b,
|
||||
0x39, 0x93, 0x13, 0x39, 0x52, 0x74, 0xc6, 0x0b, 0x58, 0xdb, 0x65, 0x1e, 0xd9, 0xe3, 0x24, 0x70,
|
||||
0x38, 0xb1, 0x89, 0x60, 0x21, 0x77, 0x89, 0xb0, 0xc9, 0xdb, 0x90, 0x88, 0x01, 0xae, 0x43, 0xce,
|
||||
0xed, 0x3a, 0xb4, 0x27, 0x8a, 0xa8, 0x92, 0xad, 0xe6, 0x6b, 0xd7, 0xcd, 0xb3, 0xe5, 0xcd, 0x9d,
|
||||
0x18, 0x6d, 0x27, 0x9b, 0x8c, 0x9f, 0x08, 0xd6, 0xd3, 0xe9, 0x45, 0xc0, 0xfa, 0x82, 0xe0, 0x57,
|
||||
0xa7, 0xf8, 0x1f, 0xcd, 0xe2, 0x3f, 0x8b, 0x4d, 0x89, 0x8b, 0x87, 0xfd, 0x01, 0x3f, 0x1c, 0x59,
|
||||
0x28, 0x0d, 0x21, 0x3f, 0x51, 0xc6, 0x2b, 0x90, 0xed, 0x90, 0xc3, 0x22, 0xaa, 0xa0, 0xaa, 0x66,
|
||||
0xc7, 0x43, 0xfc, 0x04, 0x96, 0x86, 0x4e, 0x37, 0x24, 0xc5, 0x85, 0x0a, 0xaa, 0xe6, 0x6b, 0x5b,
|
||||
0x73, 0x38, 0x18, 0x19, 0xb0, 0x15, 0xd3, 0xdd, 0x85, 0x4d, 0x64, 0x84, 0xa9, 0x17, 0x3b, 0x3e,
|
||||
0xf8, 0x7d, 0x58, 0xf6, 0xc8, 0x90, 0xba, 0x64, 0x74, 0xf2, 0x1b, 0xb3, 0x74, 0x9b, 0x12, 0x6e,
|
||||
0x8f, 0xb6, 0xe1, 0x55, 0x58, 0x22, 0x9c, 0x33, 0x2e, 0x7d, 0x6b, 0xb6, 0x9a, 0x18, 0x9f, 0x11,
|
||||
0xe4, 0x14, 0x12, 0x5f, 0x83, 0x8b, 0x5c, 0xb5, 0xf1, 0xa0, 0xef, 0xf4, 0x12, 0x21, 0xcd, 0x2e,
|
||||
0x24, 0xc5, 0xdd, 0xb8, 0x86, 0xd7, 0x40, 0x0b, 0x18, 0xeb, 0x4a, 0x44, 0xc2, 0x74, 0x21, 0x2e,
|
||||
0xc4, 0xab, 0xb8, 0x0c, 0x79, 0xa5, 0xa6, 0x96, 0xb3, 0x72, 0x19, 0x54, 0x49, 0x02, 0xee, 0xc0,
|
||||
0x25, 0xd7, 0xa3, 0x07, 0x09, 0x88, 0x7a, 0xa2, 0xb8, 0x18, 0x6b, 0x34, 0x56, 0xa2, 0xe3, 0x72,
|
||||
0x61, 0xa7, 0xd9, 0x52, 0x4e, 0x5a, 0x4d, 0x61, 0x17, 0x5c, 0x8f, 0x26, 0x33, 0x4f, 0x18, 0x2f,
|
||||
0xe1, 0x6a, 0x7c, 0x39, 0xfb, 0xfd, 0xe0, 0xff, 0xe4, 0xee, 0x17, 0x02, 0x7d, 0x9a, 0x40, 0xd2,
|
||||
0x80, 0xf6, 0x29, 0x85, 0xc7, 0xff, 0xd2, 0xf7, 0xe9, 0x7c, 0xa9, 0xd9, 0x7b, 0x37, 0x2b, 0x7b,
|
||||
0x4f, 0xff, 0xce, 0x5e, 0x7d, 0x2e, 0x0f, 0x69, 0xe9, 0xbb, 0x3d, 0xe5, 0x82, 0xc7, 0xc7, 0x1f,
|
||||
0xa7, 0x07, 0x4d, 0xa6, 0xe7, 0x19, 0x2c, 0x49, 0xc3, 0x78, 0x1d, 0x34, 0x99, 0x99, 0xc0, 0x71,
|
||||
0x49, 0x02, 0xf9, 0x53, 0xc0, 0x57, 0x20, 0x1b, 0x52, 0x4f, 0xc5, 0xa5, 0xb1, 0x1c, 0x1d, 0x97,
|
||||
0xb3, 0xfb, 0xad, 0xa6, 0x1d, 0xd7, 0x30, 0x86, 0xc5, 0x89, 0xac, 0xc8, 0x71, 0xed, 0xcb, 0x02,
|
||||
0x68, 0x4d, 0xfb, 0xc1, 0x5e, 0x37, 0xf4, 0x69, 0x1f, 0x7f, 0x44, 0xb0, 0x9a, 0xf6, 0x15, 0xe3,
|
||||
0xad, 0xf9, 0xbe, 0x7d, 0x19, 0x98, 0xd2, 0xf6, 0x79, 0x1e, 0x0e, 0x23, 0x83, 0x3f, 0x21, 0xb8,
|
||||
0x9c, 0xde, 0x61, 0x5c, 0x9f, 0x37, 0x19, 0xca, 0xd9, 0xbd, 0xf3, 0x05, 0xcb, 0xc8, 0x34, 0xb6,
|
||||
0x8f, 0x4e, 0x74, 0xf4, 0xed, 0x44, 0xcf, 0xbc, 0x8f, 0x74, 0x74, 0x14, 0xe9, 0xe8, 0x6b, 0xa4,
|
||||
0xa3, 0xef, 0x91, 0x8e, 0x3e, 0xfc, 0xd0, 0x33, 0xcf, 0x93, 0x1f, 0x82, 0x95, 0xd0, 0x5b, 0x41,
|
||||
0xc7, 0xb7, 0x62, 0x7a, 0xcb, 0xe3, 0x8e, 0x35, 0xdc, 0x68, 0xe7, 0xe4, 0x43, 0x7f, 0xeb, 0x77,
|
||||
0x00, 0x00, 0x00, 0xff, 0xff, 0x80, 0x9a, 0x7f, 0xfc, 0x44, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
@ -547,10 +549,10 @@ var _ grpc.ClientConn
|
|||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// NodeClient is the client API for Node service.
|
||||
// DRAPluginClient is the client API for DRAPlugin service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type NodeClient interface {
|
||||
type DRAPluginClient interface {
|
||||
// NodePrepareResources prepares several ResourceClaims
|
||||
// for use on the node. If an error is returned, the
|
||||
// response is ignored. Failures for individual claims
|
||||
|
@ -561,34 +563,34 @@ type NodeClient interface {
|
|||
NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error)
|
||||
}
|
||||
|
||||
type nodeClient struct {
|
||||
type dRAPluginClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewNodeClient(cc *grpc.ClientConn) NodeClient {
|
||||
return &nodeClient{cc}
|
||||
func NewDRAPluginClient(cc *grpc.ClientConn) DRAPluginClient {
|
||||
return &dRAPluginClient{cc}
|
||||
}
|
||||
|
||||
func (c *nodeClient) NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) {
|
||||
func (c *dRAPluginClient) NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) {
|
||||
out := new(NodePrepareResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, "/v1alpha3.Node/NodePrepareResources", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/k8s.io.kubelet.pkg.apis.dra.v1.DRAPlugin/NodePrepareResources", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *nodeClient) NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) {
|
||||
func (c *dRAPluginClient) NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) {
|
||||
out := new(NodeUnprepareResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, "/v1alpha3.Node/NodeUnprepareResources", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/k8s.io.kubelet.pkg.apis.dra.v1.DRAPlugin/NodeUnprepareResources", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NodeServer is the server API for Node service.
|
||||
type NodeServer interface {
|
||||
// DRAPluginServer is the server API for DRAPlugin service.
|
||||
type DRAPluginServer interface {
|
||||
// NodePrepareResources prepares several ResourceClaims
|
||||
// for use on the node. If an error is returned, the
|
||||
// response is ignored. Failures for individual claims
|
||||
|
@ -599,68 +601,68 @@ type NodeServer interface {
|
|||
NodeUnprepareResources(context.Context, *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedNodeServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedNodeServer struct {
|
||||
// UnimplementedDRAPluginServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedDRAPluginServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedNodeServer) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) {
|
||||
func (*UnimplementedDRAPluginServer) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NodePrepareResources not implemented")
|
||||
}
|
||||
func (*UnimplementedNodeServer) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) {
|
||||
func (*UnimplementedDRAPluginServer) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NodeUnprepareResources not implemented")
|
||||
}
|
||||
|
||||
func RegisterNodeServer(s *grpc.Server, srv NodeServer) {
|
||||
s.RegisterService(&_Node_serviceDesc, srv)
|
||||
func RegisterDRAPluginServer(s *grpc.Server, srv DRAPluginServer) {
|
||||
s.RegisterService(&_DRAPlugin_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _Node_NodePrepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DRAPlugin_NodePrepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NodePrepareResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServer).NodePrepareResources(ctx, in)
|
||||
return srv.(DRAPluginServer).NodePrepareResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/v1alpha3.Node/NodePrepareResources",
|
||||
FullMethod: "/k8s.io.kubelet.pkg.apis.dra.v1.DRAPlugin/NodePrepareResources",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServer).NodePrepareResources(ctx, req.(*NodePrepareResourcesRequest))
|
||||
return srv.(DRAPluginServer).NodePrepareResources(ctx, req.(*NodePrepareResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Node_NodeUnprepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _DRAPlugin_NodeUnprepareResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NodeUnprepareResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NodeServer).NodeUnprepareResources(ctx, in)
|
||||
return srv.(DRAPluginServer).NodeUnprepareResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/v1alpha3.Node/NodeUnprepareResources",
|
||||
FullMethod: "/k8s.io.kubelet.pkg.apis.dra.v1.DRAPlugin/NodeUnprepareResources",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NodeServer).NodeUnprepareResources(ctx, req.(*NodeUnprepareResourcesRequest))
|
||||
return srv.(DRAPluginServer).NodeUnprepareResources(ctx, req.(*NodeUnprepareResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _Node_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1alpha3.Node",
|
||||
HandlerType: (*NodeServer)(nil),
|
||||
var _DRAPlugin_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "k8s.io.kubelet.pkg.apis.dra.v1.DRAPlugin",
|
||||
HandlerType: (*DRAPluginServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "NodePrepareResources",
|
||||
Handler: _Node_NodePrepareResources_Handler,
|
||||
Handler: _DRAPlugin_NodePrepareResources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NodeUnprepareResources",
|
||||
Handler: _Node_NodeUnprepareResources_Handler,
|
||||
Handler: _DRAPlugin_NodeUnprepareResources_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2023 The Kubernetes Authors.
|
||||
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.
|
||||
|
@ -18,8 +18,8 @@ limitations under the License.
|
|||
|
||||
syntax = "proto3";
|
||||
|
||||
package v1alpha3;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha4";
|
||||
package k8s.io.kubelet.pkg.apis.dra.v1;
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/dra/v1";
|
||||
|
||||
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
||||
|
||||
|
@ -31,7 +31,7 @@ option (gogoproto.sizer_all) = true;
|
|||
option (gogoproto.unmarshaler_all) = true;
|
||||
option (gogoproto.goproto_unrecognized_all) = false;
|
||||
|
||||
service Node {
|
||||
service DRAPlugin {
|
||||
// NodePrepareResources prepares several ResourceClaims
|
||||
// for use on the node. If an error is returned, the
|
||||
// response is ignored. Failures for individual claims
|
||||
|
@ -95,7 +95,8 @@ message NodeUnprepareResourcesRequest {
|
|||
message NodeUnprepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
// apply. In particular, all claims in the request must
|
||||
// have an entry in the response, even if that entry is nil.
|
||||
map<string, NodeUnprepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
|
@ -14,17 +14,11 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package v1alpha4
|
||||
package v1
|
||||
|
||||
const (
|
||||
// NodeService should be listed in the "supported versions"
|
||||
// DRAPluginService needs to 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"
|
||||
// an implementation of the v1 DRAPlugin service.
|
||||
DRAPluginService = "v1.DRAPlugin"
|
||||
)
|
|
@ -1,187 +0,0 @@
|
|||
/*
|
||||
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
|
||||
}
|
|
@ -1,324 +0,0 @@
|
|||
//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)
|
||||
}
|
|
@ -326,7 +326,8 @@ func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim {
|
|||
type NodeUnprepareResourcesResponse struct {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
// apply. In particular, all claims in the request must
|
||||
// have an entry in the response, even if that entry is nil.
|
||||
Claims map[string]*NodeUnprepareResourceResponse `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
|
|
|
@ -95,7 +95,8 @@ message NodeUnprepareResourcesRequest {
|
|||
message NodeUnprepareResourcesResponse {
|
||||
// The ResourceClaims for which preparation was reverted.
|
||||
// The same rules as for NodePrepareResourcesResponse.claims
|
||||
// apply.
|
||||
// apply. In particular, all claims in the request must
|
||||
// have an entry in the response, even if that entry is nil.
|
||||
map<string, NodeUnprepareResourceResponse> claims = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
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
|
||||
|
||||
import (
|
||||
context "context"
|
||||
fmt "fmt"
|
||||
|
||||
grpc "google.golang.org/grpc"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
v1 "k8s.io/kubelet/pkg/apis/dra/v1"
|
||||
)
|
||||
|
||||
var (
|
||||
localSchemeBuilder runtime.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// V1ServerWrapper implements the [NodeServer] interface by wrapping a [v1.DRAPluginServer].
|
||||
type V1ServerWrapper struct {
|
||||
v1.DRAPluginServer
|
||||
}
|
||||
|
||||
var _ DRAPluginServer = V1ServerWrapper{}
|
||||
|
||||
func (w V1ServerWrapper) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) {
|
||||
var convertedReq v1.NodePrepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1beta1 to v1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodePrepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodePrepareResourcesResponse
|
||||
if err := Convert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1ServerWrapper) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq v1.NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1beta1 to v1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodeUnprepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1Beta1ServerWrapper implements the [v1.DRAPluginServer] interface by wrapping a [NodeServer].
|
||||
type V1Beta1ServerWrapper struct {
|
||||
DRAPluginServer
|
||||
}
|
||||
|
||||
var _ v1.DRAPluginServer = V1Beta1ServerWrapper{}
|
||||
|
||||
func (w V1Beta1ServerWrapper) NodePrepareResources(ctx context.Context, req *v1.NodePrepareResourcesRequest) (*v1.NodePrepareResourcesResponse, error) {
|
||||
var convertedReq NodePrepareResourcesRequest
|
||||
if err := Convert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodePrepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1.NodePrepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1beta1 to v1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Beta1ServerWrapper) NodeUnprepareResources(ctx context.Context, req *v1.NodeUnprepareResourcesRequest) (*v1.NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginServer.NodeUnprepareResources(ctx, &convertedReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1.NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1beta1 to v1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1ClientWrapper implements the [NodeClient] interface by wrapping a [v1.DRAPluginClient].
|
||||
type V1ClientWrapper struct {
|
||||
v1.DRAPluginClient
|
||||
}
|
||||
|
||||
var _ DRAPluginClient = V1ClientWrapper{}
|
||||
|
||||
func (w V1ClientWrapper) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest, options ...grpc.CallOption) (*NodePrepareResourcesResponse, error) {
|
||||
var convertedReq v1.NodePrepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1beta1 to v1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodePrepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodePrepareResourcesResponse
|
||||
if err := Convert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1ClientWrapper) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest, options ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq v1.NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1beta1 to v1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodeUnprepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1 to v1beta1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
// V1Beta1ClientWrapper implements the [v1.DRAPluginClient] interface by wrapping a [NodeClient].
|
||||
type V1Beta1ClientWrapper struct {
|
||||
DRAPluginClient
|
||||
}
|
||||
|
||||
var _ v1.DRAPluginClient = V1Beta1ClientWrapper{}
|
||||
|
||||
func (w V1Beta1ClientWrapper) NodePrepareResources(ctx context.Context, req *v1.NodePrepareResourcesRequest, options ...grpc.CallOption) (*v1.NodePrepareResourcesResponse, error) {
|
||||
var convertedReq NodePrepareResourcesRequest
|
||||
if err := Convert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesRequest from v1 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodePrepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1.NodePrepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodePrepareResourcesResponse from v1beta1 to v1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
||||
|
||||
func (w V1Beta1ClientWrapper) NodeUnprepareResources(ctx context.Context, req *v1.NodeUnprepareResourcesRequest, options ...grpc.CallOption) (*v1.NodeUnprepareResourcesResponse, error) {
|
||||
var convertedReq NodeUnprepareResourcesRequest
|
||||
if err := Convert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(req, &convertedReq, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesRequest from v1 to v1beta1: %w", err)
|
||||
}
|
||||
resp, err := w.DRAPluginClient.NodeUnprepareResources(ctx, &convertedReq, options...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var convertedResp v1.NodeUnprepareResourcesResponse
|
||||
if err := Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(resp, &convertedResp, nil); err != nil {
|
||||
return nil, fmt.Errorf("internal error converting NodeUnprepareResourcesResponse from v1beta1 to v1: %w", err)
|
||||
}
|
||||
return &convertedResp, nil
|
||||
}
|
|
@ -14,8 +14,8 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package v1alpha4 contains a legacy implementation of the DRA gRPC
|
||||
// Package v1beta1 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
|
||||
// +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/dra/v1
|
||||
package v1beta1
|
|
@ -0,0 +1,352 @@
|
|||
//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 v1beta1
|
||||
|
||||
import (
|
||||
unsafe "unsafe"
|
||||
|
||||
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1 "k8s.io/kubelet/pkg/apis/dra/v1"
|
||||
)
|
||||
|
||||
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), (*v1.Claim)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_Claim_To_v1_Claim(a.(*Claim), b.(*v1.Claim), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.Claim)(nil), (*Claim)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_Claim_To_v1beta1_Claim(a.(*v1.Claim), b.(*Claim), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*Device)(nil), (*v1.Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_Device_To_v1_Device(a.(*Device), b.(*v1.Device), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.Device)(nil), (*Device)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_Device_To_v1beta1_Device(a.(*v1.Device), b.(*Device), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourceResponse)(nil), (*v1.NodePrepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourceResponse_To_v1_NodePrepareResourceResponse(a.(*NodePrepareResourceResponse), b.(*v1.NodePrepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodePrepareResourceResponse)(nil), (*NodePrepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(a.(*v1.NodePrepareResourceResponse), b.(*NodePrepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourcesRequest)(nil), (*v1.NodePrepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(a.(*NodePrepareResourcesRequest), b.(*v1.NodePrepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodePrepareResourcesRequest)(nil), (*NodePrepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(a.(*v1.NodePrepareResourcesRequest), b.(*NodePrepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodePrepareResourcesResponse)(nil), (*v1.NodePrepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(a.(*NodePrepareResourcesResponse), b.(*v1.NodePrepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodePrepareResourcesResponse)(nil), (*NodePrepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(a.(*v1.NodePrepareResourcesResponse), b.(*NodePrepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourceResponse)(nil), (*v1.NodeUnprepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourceResponse_To_v1_NodeUnprepareResourceResponse(a.(*NodeUnprepareResourceResponse), b.(*v1.NodeUnprepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodeUnprepareResourceResponse)(nil), (*NodeUnprepareResourceResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(a.(*v1.NodeUnprepareResourceResponse), b.(*NodeUnprepareResourceResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourcesRequest)(nil), (*v1.NodeUnprepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(a.(*NodeUnprepareResourcesRequest), b.(*v1.NodeUnprepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodeUnprepareResourcesRequest)(nil), (*NodeUnprepareResourcesRequest)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(a.(*v1.NodeUnprepareResourcesRequest), b.(*NodeUnprepareResourcesRequest), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*NodeUnprepareResourcesResponse)(nil), (*v1.NodeUnprepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(a.(*NodeUnprepareResourcesResponse), b.(*v1.NodeUnprepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.NodeUnprepareResourcesResponse)(nil), (*NodeUnprepareResourcesResponse)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(a.(*v1.NodeUnprepareResourcesResponse), b.(*NodeUnprepareResourcesResponse), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*UnimplementedDRAPluginServer)(nil), (*v1.UnimplementedDRAPluginServer)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1beta1_UnimplementedDRAPluginServer_To_v1_UnimplementedDRAPluginServer(a.(*UnimplementedDRAPluginServer), b.(*v1.UnimplementedDRAPluginServer), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.AddGeneratedConversionFunc((*v1.UnimplementedDRAPluginServer)(nil), (*UnimplementedDRAPluginServer)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||
return Convert_v1_UnimplementedDRAPluginServer_To_v1beta1_UnimplementedDRAPluginServer(a.(*v1.UnimplementedDRAPluginServer), b.(*UnimplementedDRAPluginServer), scope)
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_Claim_To_v1_Claim(in *Claim, out *v1.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_v1_Claim is an autogenerated conversion function.
|
||||
func Convert_v1beta1_Claim_To_v1_Claim(in *Claim, out *v1.Claim, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_Claim_To_v1_Claim(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Claim_To_v1beta1_Claim(in *v1.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_v1_Claim_To_v1beta1_Claim is an autogenerated conversion function.
|
||||
func Convert_v1_Claim_To_v1beta1_Claim(in *v1.Claim, out *Claim, s conversion.Scope) error {
|
||||
return autoConvert_v1_Claim_To_v1beta1_Claim(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_Device_To_v1_Device(in *Device, out *v1.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_v1_Device is an autogenerated conversion function.
|
||||
func Convert_v1beta1_Device_To_v1_Device(in *Device, out *v1.Device, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_Device_To_v1_Device(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_Device_To_v1beta1_Device(in *v1.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_v1_Device_To_v1beta1_Device is an autogenerated conversion function.
|
||||
func Convert_v1_Device_To_v1beta1_Device(in *v1.Device, out *Device, s conversion.Scope) error {
|
||||
return autoConvert_v1_Device_To_v1beta1_Device(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourceResponse_To_v1_NodePrepareResourceResponse(in *NodePrepareResourceResponse, out *v1.NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
out.Devices = *(*[]*v1.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_v1_NodePrepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourceResponse_To_v1_NodePrepareResourceResponse(in *NodePrepareResourceResponse, out *v1.NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourceResponse_To_v1_NodePrepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in *v1.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_v1_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in *v1.NodePrepareResourceResponse, out *NodePrepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodePrepareResourceResponse_To_v1beta1_NodePrepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(in *NodePrepareResourcesRequest, out *v1.NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*v1.Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(in *NodePrepareResourcesRequest, out *v1.NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourcesRequest_To_v1_NodePrepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in *v1.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_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in *v1.NodePrepareResourcesRequest, out *NodePrepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodePrepareResourcesRequest_To_v1beta1_NodePrepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(in *NodePrepareResourcesResponse, out *v1.NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*v1.NodePrepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(in *NodePrepareResourcesResponse, out *v1.NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodePrepareResourcesResponse_To_v1_NodePrepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in *v1.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_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in *v1.NodePrepareResourcesResponse, out *NodePrepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodePrepareResourcesResponse_To_v1beta1_NodePrepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourceResponse_To_v1_NodeUnprepareResourceResponse(in *NodeUnprepareResourceResponse, out *v1.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_v1_NodeUnprepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourceResponse_To_v1_NodeUnprepareResourceResponse(in *NodeUnprepareResourceResponse, out *v1.NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourceResponse_To_v1_NodeUnprepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in *v1.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_v1_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse is an autogenerated conversion function.
|
||||
func Convert_v1_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in *v1.NodeUnprepareResourceResponse, out *NodeUnprepareResourceResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodeUnprepareResourceResponse_To_v1beta1_NodeUnprepareResourceResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(in *NodeUnprepareResourcesRequest, out *v1.NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
out.Claims = *(*[]*v1.Claim)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(in *NodeUnprepareResourcesRequest, out *v1.NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourcesRequest_To_v1_NodeUnprepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in *v1.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_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest is an autogenerated conversion function.
|
||||
func Convert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in *v1.NodeUnprepareResourcesRequest, out *NodeUnprepareResourcesRequest, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodeUnprepareResourcesRequest_To_v1beta1_NodeUnprepareResourcesRequest(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(in *NodeUnprepareResourcesResponse, out *v1.NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
out.Claims = *(*map[string]*v1.NodeUnprepareResourceResponse)(unsafe.Pointer(&in.Claims))
|
||||
out.XXX_NoUnkeyedLiteral = in.XXX_NoUnkeyedLiteral
|
||||
out.XXX_sizecache = in.XXX_sizecache
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(in *NodeUnprepareResourcesResponse, out *v1.NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_NodeUnprepareResourcesResponse_To_v1_NodeUnprepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in *v1.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_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse is an autogenerated conversion function.
|
||||
func Convert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in *v1.NodeUnprepareResourcesResponse, out *NodeUnprepareResourcesResponse, s conversion.Scope) error {
|
||||
return autoConvert_v1_NodeUnprepareResourcesResponse_To_v1beta1_NodeUnprepareResourcesResponse(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_UnimplementedDRAPluginServer_To_v1_UnimplementedDRAPluginServer(in *UnimplementedDRAPluginServer, out *v1.UnimplementedDRAPluginServer, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1beta1_UnimplementedDRAPluginServer_To_v1_UnimplementedDRAPluginServer is an autogenerated conversion function.
|
||||
func Convert_v1beta1_UnimplementedDRAPluginServer_To_v1_UnimplementedDRAPluginServer(in *UnimplementedDRAPluginServer, out *v1.UnimplementedDRAPluginServer, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_UnimplementedDRAPluginServer_To_v1_UnimplementedDRAPluginServer(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1_UnimplementedDRAPluginServer_To_v1beta1_UnimplementedDRAPluginServer(in *v1.UnimplementedDRAPluginServer, out *UnimplementedDRAPluginServer, s conversion.Scope) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Convert_v1_UnimplementedDRAPluginServer_To_v1beta1_UnimplementedDRAPluginServer is an autogenerated conversion function.
|
||||
func Convert_v1_UnimplementedDRAPluginServer_To_v1beta1_UnimplementedDRAPluginServer(in *v1.UnimplementedDRAPluginServer, out *UnimplementedDRAPluginServer, s conversion.Scope) error {
|
||||
return autoConvert_v1_UnimplementedDRAPluginServer_To_v1beta1_UnimplementedDRAPluginServer(in, out, s)
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,16 +4,6 @@ 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
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Registration_GetInfo_FullMethodName = "/pluginregistration.Registration/GetInfo"
|
||||
Registration_NotifyRegistrationStatus_FullMethodName = "/pluginregistration.Registration/NotifyRegistrationStatus"
|
||||
)
|
||||
|
||||
// RegistrationClient is the client API for Registration service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationClient interface {
|
||||
GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error)
|
||||
}
|
||||
|
||||
type registrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRegistrationClient(cc grpc.ClientConnInterface) RegistrationClient {
|
||||
return ®istrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PluginInfo)
|
||||
err := c.cc.Invoke(ctx, Registration_GetInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegistrationStatusResponse)
|
||||
err := c.cc.Invoke(ctx, Registration_NotifyRegistrationStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RegistrationServer is the server API for Registration service.
|
||||
// All implementations must embed UnimplementedRegistrationServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationServer interface {
|
||||
GetInfo(context.Context, *InfoRequest) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error)
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedRegistrationServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedRegistrationServer) GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) mustEmbedUnimplementedRegistrationServer() {}
|
||||
func (UnimplementedRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRegistrationServer interface {
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterRegistrationServer(s grpc.ServiceRegistrar, srv RegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRegistrationServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Registration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Registration_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_GetInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, req.(*InfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Registration_NotifyRegistrationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegistrationStatus)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_NotifyRegistrationStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Registration_ServiceDesc is the grpc.ServiceDesc for Registration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Registration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "pluginregistration.Registration",
|
||||
HandlerType: (*RegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetInfo",
|
||||
Handler: _Registration_GetInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyRegistrationStatus",
|
||||
Handler: _Registration_NotifyRegistrationStatus_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1/api.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,16 +4,6 @@ syntax = "proto3";
|
|||
package pluginregistration; // This should have been v1alpha1.
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/pluginregistration/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;
|
||||
|
||||
// PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration
|
||||
message PluginInfo {
|
||||
// Type of the Plugin. CSIPlugin or DevicePlugin
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1alpha1/api.proto
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Registration_GetInfo_FullMethodName = "/pluginregistration.Registration/GetInfo"
|
||||
Registration_NotifyRegistrationStatus_FullMethodName = "/pluginregistration.Registration/NotifyRegistrationStatus"
|
||||
)
|
||||
|
||||
// RegistrationClient is the client API for Registration service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationClient interface {
|
||||
GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error)
|
||||
}
|
||||
|
||||
type registrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRegistrationClient(cc grpc.ClientConnInterface) RegistrationClient {
|
||||
return ®istrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PluginInfo)
|
||||
err := c.cc.Invoke(ctx, Registration_GetInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegistrationStatusResponse)
|
||||
err := c.cc.Invoke(ctx, Registration_NotifyRegistrationStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RegistrationServer is the server API for Registration service.
|
||||
// All implementations must embed UnimplementedRegistrationServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationServer interface {
|
||||
GetInfo(context.Context, *InfoRequest) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error)
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedRegistrationServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedRegistrationServer) GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) mustEmbedUnimplementedRegistrationServer() {}
|
||||
func (UnimplementedRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRegistrationServer interface {
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterRegistrationServer(s grpc.ServiceRegistrar, srv RegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRegistrationServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Registration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Registration_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_GetInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, req.(*InfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Registration_NotifyRegistrationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegistrationStatus)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_NotifyRegistrationStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Registration_ServiceDesc is the grpc.ServiceDesc for Registration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Registration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "pluginregistration.Registration",
|
||||
HandlerType: (*RegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetInfo",
|
||||
Handler: _Registration_GetInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyRegistrationStatus",
|
||||
Handler: _Registration_NotifyRegistrationStatus_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1alpha1/api.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,16 +4,6 @@ syntax = "proto3";
|
|||
package pluginregistration; // This should have been v1beta1.
|
||||
option go_package = "k8s.io/kubelet/pkg/apis/pluginregistration/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;
|
||||
|
||||
// PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration
|
||||
message PluginInfo {
|
||||
// Type of the Plugin. CSIPlugin or DevicePlugin
|
||||
|
|
|
@ -0,0 +1,181 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1beta1/api.proto
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
Registration_GetInfo_FullMethodName = "/pluginregistration.Registration/GetInfo"
|
||||
Registration_NotifyRegistrationStatus_FullMethodName = "/pluginregistration.Registration/NotifyRegistrationStatus"
|
||||
)
|
||||
|
||||
// RegistrationClient is the client API for Registration service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationClient interface {
|
||||
GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error)
|
||||
}
|
||||
|
||||
type registrationClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRegistrationClient(cc grpc.ClientConnInterface) RegistrationClient {
|
||||
return ®istrationClient{cc}
|
||||
}
|
||||
|
||||
func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PluginInfo)
|
||||
err := c.cc.Invoke(ctx, Registration_GetInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RegistrationStatusResponse)
|
||||
err := c.cc.Invoke(ctx, Registration_NotifyRegistrationStatus_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RegistrationServer is the server API for Registration service.
|
||||
// All implementations must embed UnimplementedRegistrationServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// Registration is the service advertised by the Plugins.
|
||||
type RegistrationServer interface {
|
||||
GetInfo(context.Context, *InfoRequest) (*PluginInfo, error)
|
||||
NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error)
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
// UnimplementedRegistrationServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRegistrationServer struct{}
|
||||
|
||||
func (UnimplementedRegistrationServer) GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented")
|
||||
}
|
||||
func (UnimplementedRegistrationServer) mustEmbedUnimplementedRegistrationServer() {}
|
||||
func (UnimplementedRegistrationServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRegistrationServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RegistrationServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRegistrationServer interface {
|
||||
mustEmbedUnimplementedRegistrationServer()
|
||||
}
|
||||
|
||||
func RegisterRegistrationServer(s grpc.ServiceRegistrar, srv RegistrationServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRegistrationServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&Registration_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Registration_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(InfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_GetInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).GetInfo(ctx, req.(*InfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Registration_NotifyRegistrationStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RegistrationStatus)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Registration_NotifyRegistrationStatus_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Registration_ServiceDesc is the grpc.ServiceDesc for Registration service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Registration_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "pluginregistration.Registration",
|
||||
HandlerType: (*RegistrationServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "GetInfo",
|
||||
Handler: _Registration_GetInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyRegistrationStatus",
|
||||
Handler: _Registration_NotifyRegistrationStatus_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/pluginregistration/v1beta1/api.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,16 +4,6 @@ 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
|
||||
|
@ -94,7 +84,7 @@ message DynamicResource {
|
|||
// 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"];
|
||||
repeated CDIDevice cdi_devices = 1;
|
||||
string driver_name = 2;
|
||||
string pool_name = 3;
|
||||
string device_name = 4;
|
||||
|
|
|
@ -0,0 +1,221 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PodResourcesLister_List_FullMethodName = "/v1.PodResourcesLister/List"
|
||||
PodResourcesLister_GetAllocatableResources_FullMethodName = "/v1.PodResourcesLister/GetAllocatableResources"
|
||||
PodResourcesLister_Get_FullMethodName = "/v1.PodResourcesLister/Get"
|
||||
)
|
||||
|
||||
// PodResourcesListerClient is the client API for PodResourcesLister service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
type PodResourcesListerClient interface {
|
||||
List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error)
|
||||
GetAllocatableResources(ctx context.Context, in *AllocatableResourcesRequest, opts ...grpc.CallOption) (*AllocatableResourcesResponse, error)
|
||||
Get(ctx context.Context, in *GetPodResourcesRequest, opts ...grpc.CallOption) (*GetPodResourcesResponse, error)
|
||||
}
|
||||
|
||||
type podResourcesListerClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPodResourcesListerClient(cc grpc.ClientConnInterface) PodResourcesListerClient {
|
||||
return &podResourcesListerClient{cc}
|
||||
}
|
||||
|
||||
func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPodResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, PodResourcesLister_List_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *podResourcesListerClient) GetAllocatableResources(ctx context.Context, in *AllocatableResourcesRequest, opts ...grpc.CallOption) (*AllocatableResourcesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(AllocatableResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, PodResourcesLister_GetAllocatableResources_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *podResourcesListerClient) Get(ctx context.Context, in *GetPodResourcesRequest, opts ...grpc.CallOption) (*GetPodResourcesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPodResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, PodResourcesLister_Get_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PodResourcesListerServer is the server API for PodResourcesLister service.
|
||||
// All implementations must embed UnimplementedPodResourcesListerServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
type PodResourcesListerServer interface {
|
||||
List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error)
|
||||
GetAllocatableResources(context.Context, *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error)
|
||||
Get(context.Context, *GetPodResourcesRequest) (*GetPodResourcesResponse, error)
|
||||
mustEmbedUnimplementedPodResourcesListerServer()
|
||||
}
|
||||
|
||||
// UnimplementedPodResourcesListerServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPodResourcesListerServer struct{}
|
||||
|
||||
func (UnimplementedPodResourcesListerServer) List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedPodResourcesListerServer) GetAllocatableResources(context.Context, *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetAllocatableResources not implemented")
|
||||
}
|
||||
func (UnimplementedPodResourcesListerServer) Get(context.Context, *GetPodResourcesRequest) (*GetPodResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedPodResourcesListerServer) mustEmbedUnimplementedPodResourcesListerServer() {}
|
||||
func (UnimplementedPodResourcesListerServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePodResourcesListerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PodResourcesListerServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePodResourcesListerServer interface {
|
||||
mustEmbedUnimplementedPodResourcesListerServer()
|
||||
}
|
||||
|
||||
func RegisterPodResourcesListerServer(s grpc.ServiceRegistrar, srv PodResourcesListerServer) {
|
||||
// If the following call pancis, it indicates UnimplementedPodResourcesListerServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PodResourcesLister_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PodResourcesLister_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPodResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PodResourcesListerServer).List(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PodResourcesLister_List_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PodResourcesListerServer).List(ctx, req.(*ListPodResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PodResourcesLister_GetAllocatableResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AllocatableResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PodResourcesListerServer).GetAllocatableResources(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PodResourcesLister_GetAllocatableResources_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PodResourcesListerServer).GetAllocatableResources(ctx, req.(*AllocatableResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PodResourcesLister_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetPodResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PodResourcesListerServer).Get(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PodResourcesLister_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PodResourcesListerServer).Get(ctx, req.(*GetPodResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PodResourcesLister_ServiceDesc is the grpc.ServiceDesc for PodResourcesLister service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PodResourcesLister_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1.PodResourcesLister",
|
||||
HandlerType: (*PodResourcesListerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "List",
|
||||
Handler: _PodResourcesLister_List_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetAllocatableResources",
|
||||
Handler: _PodResourcesLister_GetAllocatableResources_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Get",
|
||||
Handler: _PodResourcesLister_Get_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/podresources/v1/api.proto",
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,17 +4,6 @@ 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 {
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
// To regenerate api.pb.go run `hack/update-codegen.sh protobindings`
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v4.23.4
|
||||
// source: staging/src/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.proto
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PodResourcesLister_List_FullMethodName = "/v1alpha1.PodResourcesLister/List"
|
||||
)
|
||||
|
||||
// PodResourcesListerClient is the client API for PodResourcesLister service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
type PodResourcesListerClient interface {
|
||||
List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error)
|
||||
}
|
||||
|
||||
type podResourcesListerClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewPodResourcesListerClient(cc grpc.ClientConnInterface) PodResourcesListerClient {
|
||||
return &podResourcesListerClient{cc}
|
||||
}
|
||||
|
||||
func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPodResourcesResponse)
|
||||
err := c.cc.Invoke(ctx, PodResourcesLister_List_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// PodResourcesListerServer is the server API for PodResourcesLister service.
|
||||
// All implementations must embed UnimplementedPodResourcesListerServer
|
||||
// for forward compatibility.
|
||||
//
|
||||
// PodResourcesLister is a service provided by the kubelet that provides information about the
|
||||
// node resources consumed by pods and containers on the node
|
||||
type PodResourcesListerServer interface {
|
||||
List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error)
|
||||
mustEmbedUnimplementedPodResourcesListerServer()
|
||||
}
|
||||
|
||||
// UnimplementedPodResourcesListerServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPodResourcesListerServer struct{}
|
||||
|
||||
func (UnimplementedPodResourcesListerServer) List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedPodResourcesListerServer) mustEmbedUnimplementedPodResourcesListerServer() {}
|
||||
func (UnimplementedPodResourcesListerServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafePodResourcesListerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to PodResourcesListerServer will
|
||||
// result in compilation errors.
|
||||
type UnsafePodResourcesListerServer interface {
|
||||
mustEmbedUnimplementedPodResourcesListerServer()
|
||||
}
|
||||
|
||||
func RegisterPodResourcesListerServer(s grpc.ServiceRegistrar, srv PodResourcesListerServer) {
|
||||
// If the following call pancis, it indicates UnimplementedPodResourcesListerServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&PodResourcesLister_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _PodResourcesLister_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListPodResourcesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PodResourcesListerServer).List(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PodResourcesLister_List_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PodResourcesListerServer).List(ctx, req.(*ListPodResourcesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// PodResourcesLister_ServiceDesc is the grpc.ServiceDesc for PodResourcesLister service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var PodResourcesLister_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "v1alpha1.PodResourcesLister",
|
||||
HandlerType: (*PodResourcesListerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "List",
|
||||
Handler: _PodResourcesLister_List_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "staging/src/k8s.io/kubelet/pkg/apis/podresources/v1alpha1/api.proto",
|
||||
}
|
|
@ -140,7 +140,7 @@ func (h *httpStreamHandler) getStreamPair(requestID string) (*httpStreamPair, bo
|
|||
func (h *httpStreamHandler) monitorStreamPair(p *httpStreamPair, timeout <-chan time.Time) {
|
||||
select {
|
||||
case <-timeout:
|
||||
err := fmt.Errorf("(conn=%v, request=%s) timed out waiting for streams", h.conn, p.requestID)
|
||||
err := fmt.Errorf("(conn=%p, request=%s) timed out waiting for streams", h.conn, p.requestID)
|
||||
utilruntime.HandleError(err)
|
||||
p.printError(err.Error())
|
||||
case <-p.complete:
|
||||
|
|
Loading…
Reference in New Issue