pax_global_header00006660000000000000000000000064150356137470014525gustar00rootroot0000000000000052 comment=1136df05d75061037a4510d996279eb8678e5da2 kubelet-kubernetes-1.32.7/000077500000000000000000000000001503561374700154175ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/.github/000077500000000000000000000000001503561374700167575ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/.github/PULL_REQUEST_TEMPLATE.md000066400000000000000000000002251503561374700225570ustar00rootroot00000000000000Sorry, we do not accept changes directly against this repository. Please see CONTRIBUTING.md for information on where and how to contribute instead. kubelet-kubernetes-1.32.7/CONTRIBUTING.md000066400000000000000000000013401503561374700176460ustar00rootroot00000000000000# Contributing guidelines Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/kubelet](https://git.k8s.io/kubernetes/staging/src/k8s.io/kubelet) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information kubelet-kubernetes-1.32.7/LICENSE000066400000000000000000000261361503561374700164340ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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. kubelet-kubernetes-1.32.7/OWNERS000066400000000000000000000002531503561374700163570ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - sig-node-approvers - sttts - luxas - mtaufen reviewers: - sig-node-reviewers - luxas - sttts kubelet-kubernetes-1.32.7/README.md000066400000000000000000000013771503561374700167060ustar00rootroot00000000000000# 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) This repo provides external, versioned ComponentConfig API types for configuring the kubelet. These external types can easily be vendored and used by any third-party tool writing Kubernetes ComponentConfig objects. ## Compatibility HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. ## Where does it come from? This repo is synced from https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/kubelet. Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here by a bot. kubelet-kubernetes-1.32.7/SECURITY_CONTACTS000066400000000000000000000010631503561374700201070ustar00rootroot00000000000000# Defined below are the security contacts for this repo. # # They are the contact point for the Product Security Committee to reach out # to for triaging and handling of incoming issues. # # The below names agree to abide by the # [Embargo Policy](https://git.k8s.io/security/private-distributors-list.md#embargo-policy) # and will be removed and replaced if they violate that agreement. # # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ cjcullen joelsmith liggitt philips tallclair kubelet-kubernetes-1.32.7/code-of-conduct.md000066400000000000000000000002241503561374700207100ustar00rootroot00000000000000# Kubernetes Community Code of Conduct Please refer to our [Kubernetes Community Code of Conduct](https://git.k8s.io/community/code-of-conduct.md) kubelet-kubernetes-1.32.7/config/000077500000000000000000000000001503561374700166645ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/config/OWNERS000066400000000000000000000003661503561374700176310ustar00rootroot00000000000000# 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: - api-reviewers - sig-node-reviewers labels: - kind/api-change kubelet-kubernetes-1.32.7/config/v1/000077500000000000000000000000001503561374700172125ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/config/v1/doc.go000066400000000000000000000013061503561374700203060ustar00rootroot00000000000000/* Copyright 2022 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. */ // +k8s:deepcopy-gen=package // +k8s:openapi-gen=true // +groupName=kubelet.config.k8s.io package v1 // import "k8s.io/kubelet/config/v1" kubelet-kubernetes-1.32.7/config/v1/register.go000066400000000000000000000025771503561374700214000ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name used in this package const GroupName = "kubelet.config.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} var ( // SchemeBuilder is the scheme builder with scheme init functions to run for this API package SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme ) // addKnownTypes registers known types to the given scheme func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderConfig{}, ) return nil } kubelet-kubernetes-1.32.7/config/v1/register_test.go000066400000000000000000000020021503561374700224160ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( "testing" componentconfigtesting "k8s.io/component-base/config/testing" ) func TestComponentConfigSetup(t *testing.T) { pkginfo := &componentconfigtesting.ComponentConfigPackage{ ComponentName: "kubelet", GroupName: GroupName, SchemeGroupVersion: SchemeGroupVersion, AddToScheme: AddToScheme, } if err := componentconfigtesting.VerifyExternalTypePackage(pkginfo); err != nil { t.Fatal(err) } } kubelet-kubernetes-1.32.7/config/v1/types.go000066400000000000000000000105011503561374700207020ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderConfig is the configuration containing information about // each exec credential provider. Kubelet reads this configuration from disk and enables // each provider as specified by the CredentialProvider type. type CredentialProviderConfig struct { metav1.TypeMeta `json:",inline"` // providers is a list of credential provider plugins that will be enabled by the kubelet. // Multiple providers may match against a single image, in which case credentials // from all providers will be returned to the kubelet. If multiple providers are called // for a single image, the results are combined. If providers return overlapping // auth keys, the value from the provider earlier in this list is used. Providers []CredentialProvider `json:"providers"` } // CredentialProvider represents an exec plugin to be invoked by the kubelet. The plugin is only // invoked when an image being pulled matches the images handled by the plugin (see matchImages). type CredentialProvider struct { // name is the required name of the credential provider. It must match the name of the // provider executable as seen by the kubelet. The executable must be in the kubelet's // bin directory (set by the --image-credential-provider-bin-dir flag). Name string `json:"name"` // matchImages is a required list of strings used to match against images in order to // determine if this provider should be invoked. If one of the strings matches the // requested image from the kubelet, the plugin will be invoked and given a chance // to provide credentials. Images are expected to contain the registry domain // and URL path. // // Each entry in matchImages is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // A match exists between an image and a matchImage when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // Example values of matchImages: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path MatchImages []string `json:"matchImages"` // defaultCacheDuration is the default duration the plugin will cache credentials in-memory // if a cache duration is not provided in the plugin response. This field is required. DefaultCacheDuration *metav1.Duration `json:"defaultCacheDuration"` // Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse // MUST use the same encoding version as the input. Current supported values are: // - credentialprovider.kubelet.k8s.io/v1 APIVersion string `json:"apiVersion"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args,omitempty"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env,omitempty"` } // ExecEnvVar is used for setting environment variables when executing an exec-based // credential plugin. type ExecEnvVar struct { Name string `json:"name"` Value string `json:"value"` } kubelet-kubernetes-1.32.7/config/v1/zz_generated.deepcopy.go000066400000000000000000000061471503561374700240410ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProvider) DeepCopyInto(out *CredentialProvider) { *out = *in if in.MatchImages != nil { in, out := &in.MatchImages, &out.MatchImages *out = make([]string, len(*in)) copy(*out, *in) } if in.DefaultCacheDuration != nil { in, out := &in.DefaultCacheDuration, &out.DefaultCacheDuration *out = new(metav1.Duration) **out = **in } if in.Args != nil { in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProvider. func (in *CredentialProvider) DeepCopy() *CredentialProvider { if in == nil { return nil } out := new(CredentialProvider) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderConfig) DeepCopyInto(out *CredentialProviderConfig) { *out = *in out.TypeMeta = in.TypeMeta if in.Providers != nil { in, out := &in.Providers, &out.Providers *out = make([]CredentialProvider, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderConfig. func (in *CredentialProviderConfig) DeepCopy() *CredentialProviderConfig { if in == nil { return nil } out := new(CredentialProviderConfig) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderConfig) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { if in == nil { return nil } out := new(ExecEnvVar) in.DeepCopyInto(out) return out } kubelet-kubernetes-1.32.7/config/v1alpha1/000077500000000000000000000000001503561374700203015ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/config/v1alpha1/doc.go000066400000000000000000000013221503561374700213730ustar00rootroot00000000000000/* Copyright 2020 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. */ // +k8s:deepcopy-gen=package // +k8s:openapi-gen=true // +groupName=kubelet.config.k8s.io package v1alpha1 // import "k8s.io/kubelet/config/v1alpha1" kubelet-kubernetes-1.32.7/config/v1alpha1/register.go000066400000000000000000000026131503561374700224560ustar00rootroot00000000000000/* Copyright 2020 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 v1alpha1 import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name used in this package const GroupName = "kubelet.config.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} var ( // SchemeBuilder is the scheme builder with scheme init functions to run for this API package SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme ) // addKnownTypes registers known types to the given scheme func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderConfig{}, ) return nil } kubelet-kubernetes-1.32.7/config/v1alpha1/types.go000066400000000000000000000105331503561374700217760ustar00rootroot00000000000000/* Copyright 2020 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 v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderConfig is the configuration containing information about // each exec credential provider. Kubelet reads this configuration from disk and enables // each provider as specified by the CredentialProvider type. type CredentialProviderConfig struct { metav1.TypeMeta `json:",inline"` // providers is a list of credential provider plugins that will be enabled by the kubelet. // Multiple providers may match against a single image, in which case credentials // from all providers will be returned to the kubelet. If multiple providers are called // for a single image, the results are combined. If providers return overlapping // auth keys, the value from the provider earlier in this list is used. Providers []CredentialProvider `json:"providers"` } // CredentialProvider represents an exec plugin to be invoked by the kubelet. The plugin is only // invoked when an image being pulled matches the images handled by the plugin (see matchImages). type CredentialProvider struct { // name is the required name of the credential provider. It must match the name of the // provider executable as seen by the kubelet. The executable must be in the kubelet's // bin directory (set by the --image-credential-provider-bin-dir flag). Name string `json:"name"` // matchImages is a required list of strings used to match against images in order to // determine if this provider should be invoked. If one of the strings matches the // requested image from the kubelet, the plugin will be invoked and given a chance // to provide credentials. Images are expected to contain the registry domain // and URL path. // // Each entry in matchImages is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like `*.k8s.io` or `k8s.*.io`, and top-level-domains such as `k8s.*`. // Matching partial subdomains like `app*.k8s.io` is also supported. Each glob can only match // a single subdomain segment, so `*.io` does not match `*.k8s.io`. // // A match exists between an image and a matchImage when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // Example values of matchImages: // - `123456789.dkr.ecr.us-east-1.amazonaws.com` // - `*.azurecr.io` // - `gcr.io` // - `*.*.registry.io` // - `registry.io:8080/path` MatchImages []string `json:"matchImages"` // defaultCacheDuration is the default duration the plugin will cache credentials in-memory // if a cache duration is not provided in the plugin response. This field is required. DefaultCacheDuration *metav1.Duration `json:"defaultCacheDuration"` // Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse // MUST use the same encoding version as the input. Current supported values are: // - credentialprovider.kubelet.k8s.io/v1alpha1 APIVersion string `json:"apiVersion"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args,omitempty"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env,omitempty"` } // ExecEnvVar is used for setting environment variables when executing an exec-based // credential plugin. type ExecEnvVar struct { Name string `json:"name"` Value string `json:"value"` } kubelet-kubernetes-1.32.7/config/v1alpha1/zz_generated.deepcopy.go000066400000000000000000000061451503561374700251260ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProvider) DeepCopyInto(out *CredentialProvider) { *out = *in if in.MatchImages != nil { in, out := &in.MatchImages, &out.MatchImages *out = make([]string, len(*in)) copy(*out, *in) } if in.DefaultCacheDuration != nil { in, out := &in.DefaultCacheDuration, &out.DefaultCacheDuration *out = new(v1.Duration) **out = **in } if in.Args != nil { in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProvider. func (in *CredentialProvider) DeepCopy() *CredentialProvider { if in == nil { return nil } out := new(CredentialProvider) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderConfig) DeepCopyInto(out *CredentialProviderConfig) { *out = *in out.TypeMeta = in.TypeMeta if in.Providers != nil { in, out := &in.Providers, &out.Providers *out = make([]CredentialProvider, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderConfig. func (in *CredentialProviderConfig) DeepCopy() *CredentialProviderConfig { if in == nil { return nil } out := new(CredentialProviderConfig) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderConfig) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { if in == nil { return nil } out := new(ExecEnvVar) in.DeepCopyInto(out) return out } kubelet-kubernetes-1.32.7/config/v1beta1/000077500000000000000000000000001503561374700201275ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/config/v1beta1/doc.go000066400000000000000000000013201503561374700212170ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // +k8s:deepcopy-gen=package // +k8s:openapi-gen=true // +groupName=kubelet.config.k8s.io package v1beta1 // import "k8s.io/kubelet/config/v1beta1" kubelet-kubernetes-1.32.7/config/v1beta1/register.go000066400000000000000000000027051503561374700223060ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name used in this package const GroupName = "kubelet.config.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} var ( // SchemeBuilder is the scheme builder with scheme init functions to run for this API package SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is a global function that registers this API group & version to a scheme AddToScheme = SchemeBuilder.AddToScheme ) // addKnownTypes registers known types to the given scheme func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &KubeletConfiguration{}, &SerializedNodeConfigSource{}, &CredentialProviderConfig{}, ) return nil } kubelet-kubernetes-1.32.7/config/v1beta1/register_test.go000066400000000000000000000020071503561374700233400ustar00rootroot00000000000000/* Copyright 2020 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 ( "testing" componentconfigtesting "k8s.io/component-base/config/testing" ) func TestComponentConfigSetup(t *testing.T) { pkginfo := &componentconfigtesting.ComponentConfigPackage{ ComponentName: "kubelet", GroupName: GroupName, SchemeGroupVersion: SchemeGroupVersion, AddToScheme: AddToScheme, } if err := componentconfigtesting.VerifyExternalTypePackage(pkginfo); err != nil { t.Fatal(err) } } kubelet-kubernetes-1.32.7/config/v1beta1/types.go000066400000000000000000001463061503561374700216340ustar00rootroot00000000000000/* Copyright 2017 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 ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" logsapi "k8s.io/component-base/logs/api/v1" tracingapi "k8s.io/component-base/tracing/api/v1" ) // HairpinMode denotes how the kubelet should configure networking to handle // hairpin packets. type HairpinMode string // Enum settings for different ways to handle hairpin packets. const ( // Set the hairpin flag on the veth of containers in the respective // container runtime. HairpinVeth = "hairpin-veth" // Make the container bridge promiscuous. This will force it to accept // hairpin packets, even if the flag isn't set on ports of the bridge. PromiscuousBridge = "promiscuous-bridge" // Neither of the above. If the kubelet is started in this hairpin mode // and kube-proxy is running in iptables mode, hairpin packets will be // dropped by the container bridge. HairpinNone = "none" ) // ResourceChangeDetectionStrategy denotes a mode in which internal // managers (secret, configmap) are discovering object changes. type ResourceChangeDetectionStrategy string // Enum settings for different strategies of kubelet managers. const ( // GetChangeDetectionStrategy is a mode in which kubelet fetches // necessary objects directly from apiserver. GetChangeDetectionStrategy ResourceChangeDetectionStrategy = "Get" // TTLCacheChangeDetectionStrategy is a mode in which kubelet uses // ttl cache for object directly fetched from apiserver. TTLCacheChangeDetectionStrategy ResourceChangeDetectionStrategy = "Cache" // WatchChangeDetectionStrategy is a mode in which kubelet uses // watches to observe changes to objects that are in its interest. WatchChangeDetectionStrategy ResourceChangeDetectionStrategy = "Watch" // RestrictedTopologyManagerPolicy is a mode in which kubelet only allows // pods with optimal NUMA node alignment for requested resources RestrictedTopologyManagerPolicy = "restricted" // BestEffortTopologyManagerPolicy is a mode in which kubelet will favour // pods with NUMA alignment of CPU and device resources. BestEffortTopologyManagerPolicy = "best-effort" // NoneTopologyManagerPolicy is a mode in which kubelet has no knowledge // of NUMA alignment of a pod's CPU and device resources. NoneTopologyManagerPolicy = "none" // SingleNumaNodeTopologyManagerPolicy is a mode in which kubelet only allows // pods with a single NUMA alignment of CPU and device resources. SingleNumaNodeTopologyManagerPolicy = "single-numa-node" // ContainerTopologyManagerScope represents that // topology policy is applied on a per-container basis. ContainerTopologyManagerScope = "container" // PodTopologyManagerScope represents that // topology policy is applied on a per-pod basis. PodTopologyManagerScope = "pod" // NoneMemoryManagerPolicy is a memory manager none policy, under the none policy // the memory manager will not pin containers memory of guaranteed pods NoneMemoryManagerPolicy = "None" // StaticMemoryManagerPolicy is a memory manager static policy, under the static policy // the memory manager will try to pin containers memory of guaranteed pods to the smallest // possible sub-set of NUMA nodes StaticMemoryManagerPolicy = "Static" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // KubeletConfiguration contains the configuration for the Kubelet type KubeletConfiguration struct { metav1.TypeMeta `json:",inline"` // enableServer enables Kubelet's secured server. // Note: Kubelet's insecure port is controlled by the readOnlyPort option. // Default: true EnableServer *bool `json:"enableServer,omitempty"` // staticPodPath is the path to the directory containing local (static) pods to // run, or the path to a single static pod file. // Default: "" // +optional StaticPodPath string `json:"staticPodPath,omitempty"` // podLogsDir is a custom root directory path kubelet will use to place pod's log files. // Default: "/var/log/pods/" // Note: it is not recommended to use the temp folder as a log directory as it may cause // unexpected behavior in many places. // +optional PodLogsDir string `json:"podLogsDir,omitempty"` // syncFrequency is the max period between synchronizing running // containers and config. // Default: "1m" // +optional SyncFrequency metav1.Duration `json:"syncFrequency,omitempty"` // fileCheckFrequency is the duration between checking config files for // new data. // Default: "20s" // +optional FileCheckFrequency metav1.Duration `json:"fileCheckFrequency,omitempty"` // httpCheckFrequency is the duration between checking http for new data. // Default: "20s" // +optional HTTPCheckFrequency metav1.Duration `json:"httpCheckFrequency,omitempty"` // staticPodURL is the URL for accessing static pods to run. // Default: "" // +optional StaticPodURL string `json:"staticPodURL,omitempty"` // staticPodURLHeader is a map of slices with HTTP headers to use when accessing the podURL. // Default: nil // +optional StaticPodURLHeader map[string][]string `json:"staticPodURLHeader,omitempty"` // address is the IP address for the Kubelet to serve on (set to 0.0.0.0 // for all interfaces). // Default: "0.0.0.0" // +optional Address string `json:"address,omitempty"` // port is the port for the Kubelet to serve on. // The port number must be between 1 and 65535, inclusive. // Default: 10250 // +optional Port int32 `json:"port,omitempty"` // readOnlyPort is the read-only port for the Kubelet to serve on with // no authentication/authorization. // The port number must be between 1 and 65535, inclusive. // Setting this field to 0 disables the read-only service. // Default: 0 (disabled) // +optional ReadOnlyPort int32 `json:"readOnlyPort,omitempty"` // tlsCertFile is the file containing x509 Certificate for HTTPS. (CA cert, // if any, concatenated after server cert). If tlsCertFile and // tlsPrivateKeyFile are not provided, a self-signed certificate // and key are generated for the public address and saved to the directory // passed to the Kubelet's --cert-dir flag. // Default: "" // +optional TLSCertFile string `json:"tlsCertFile,omitempty"` // tlsPrivateKeyFile is the file containing x509 private key matching tlsCertFile. // Default: "" // +optional TLSPrivateKeyFile string `json:"tlsPrivateKeyFile,omitempty"` // tlsCipherSuites is the list of allowed cipher suites for the server. // Note that TLS 1.3 ciphersuites are not configurable. // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). // Default: nil // +optional TLSCipherSuites []string `json:"tlsCipherSuites,omitempty"` // tlsMinVersion is the minimum TLS version supported. // Values are from tls package constants (https://golang.org/pkg/crypto/tls/#pkg-constants). // Default: "" // +optional TLSMinVersion string `json:"tlsMinVersion,omitempty"` // rotateCertificates enables client certificate rotation. The Kubelet will request a // new certificate from the certificates.k8s.io API. This requires an approver to approve the // certificate signing requests. // Default: false // +optional RotateCertificates bool `json:"rotateCertificates,omitempty"` // serverTLSBootstrap enables server certificate bootstrap. Instead of self // signing a serving certificate, the Kubelet will request a certificate from // the 'certificates.k8s.io' API. This requires an approver to approve the // certificate signing requests (CSR). The RotateKubeletServerCertificate feature // must be enabled when setting this field. // Default: false // +optional ServerTLSBootstrap bool `json:"serverTLSBootstrap,omitempty"` // authentication specifies how requests to the Kubelet's server are authenticated. // Defaults: // anonymous: // enabled: false // webhook: // enabled: true // cacheTTL: "2m" // +optional Authentication KubeletAuthentication `json:"authentication"` // authorization specifies how requests to the Kubelet's server are authorized. // Defaults: // mode: Webhook // webhook: // cacheAuthorizedTTL: "5m" // cacheUnauthorizedTTL: "30s" // +optional Authorization KubeletAuthorization `json:"authorization"` // registryPullQPS is the limit of registry pulls per second. // The value must not be a negative number. // Setting it to 0 means no limit. // Default: 5 // +optional RegistryPullQPS *int32 `json:"registryPullQPS,omitempty"` // registryBurst is the maximum size of bursty pulls, temporarily allows // pulls to burst to this number, while still not exceeding registryPullQPS. // The value must not be a negative number. // Only used if registryPullQPS is greater than 0. // Default: 10 // +optional RegistryBurst int32 `json:"registryBurst,omitempty"` // eventRecordQPS is the maximum event creations per second. If 0, there // is no limit enforced. The value cannot be a negative number. // Default: 50 // +optional EventRecordQPS *int32 `json:"eventRecordQPS,omitempty"` // eventBurst is the maximum size of a burst of event creations, temporarily // allows event creations to burst to this number, while still not exceeding // eventRecordQPS. This field canot be a negative number and it is only used // when eventRecordQPS > 0. // Default: 100 // +optional EventBurst int32 `json:"eventBurst,omitempty"` // enableDebuggingHandlers enables server endpoints for log access // and local running of containers and commands, including the exec, // attach, logs, and portforward features. // Default: true // +optional EnableDebuggingHandlers *bool `json:"enableDebuggingHandlers,omitempty"` // enableContentionProfiling enables block profiling, if enableDebuggingHandlers is true. // Default: false // +optional EnableContentionProfiling bool `json:"enableContentionProfiling,omitempty"` // healthzPort is the port of the localhost healthz endpoint (set to 0 to disable). // A valid number is between 1 and 65535. // Default: 10248 // +optional HealthzPort *int32 `json:"healthzPort,omitempty"` // healthzBindAddress is the IP address for the healthz server to serve on. // Default: "127.0.0.1" // +optional HealthzBindAddress string `json:"healthzBindAddress,omitempty"` // oomScoreAdj is The oom-score-adj value for kubelet process. Values // must be within the range [-1000, 1000]. // Default: -999 // +optional OOMScoreAdj *int32 `json:"oomScoreAdj,omitempty"` // clusterDomain is the DNS domain for this cluster. If set, kubelet will // configure all containers to search this domain in addition to the // host's search domains. // Default: "" // +optional ClusterDomain string `json:"clusterDomain,omitempty"` // clusterDNS is a list of IP addresses for the cluster DNS server. If set, // kubelet will configure all containers to use this for DNS resolution // instead of the host's DNS servers. // Default: nil // +optional ClusterDNS []string `json:"clusterDNS,omitempty"` // streamingConnectionIdleTimeout is the maximum time a streaming connection // can be idle before the connection is automatically closed. // Default: "4h" // +optional StreamingConnectionIdleTimeout metav1.Duration `json:"streamingConnectionIdleTimeout,omitempty"` // nodeStatusUpdateFrequency is the frequency that kubelet computes node // status. If node lease feature is not enabled, it is also the frequency that // kubelet posts node status to master. // Note: When node lease feature is not enabled, be cautious when changing the // constant, it must work with nodeMonitorGracePeriod in nodecontroller. // Default: "10s" // +optional NodeStatusUpdateFrequency metav1.Duration `json:"nodeStatusUpdateFrequency,omitempty"` // nodeStatusReportFrequency is the frequency that kubelet posts node // status to master if node status does not change. Kubelet will ignore this // frequency and post node status immediately if any change is detected. It is // only used when node lease feature is enabled. nodeStatusReportFrequency's // default value is 5m. But if nodeStatusUpdateFrequency is set explicitly, // nodeStatusReportFrequency's default value will be set to // nodeStatusUpdateFrequency for backward compatibility. // Default: "5m" // +optional NodeStatusReportFrequency metav1.Duration `json:"nodeStatusReportFrequency,omitempty"` // nodeLeaseDurationSeconds is the duration the Kubelet will set on its corresponding Lease. // NodeLease provides an indicator of node health by having the Kubelet create and // periodically renew a lease, named after the node, in the kube-node-lease namespace. // If the lease expires, the node can be considered unhealthy. // The lease is currently renewed every 10s, per KEP-0009. In the future, the lease renewal // interval may be set based on the lease duration. // The field value must be greater than 0. // Default: 40 // +optional NodeLeaseDurationSeconds int32 `json:"nodeLeaseDurationSeconds,omitempty"` // imageMinimumGCAge is the minimum age for an unused image before it is // garbage collected. // Default: "2m" // +optional ImageMinimumGCAge metav1.Duration `json:"imageMinimumGCAge,omitempty"` // imageMaximumGCAge is the maximum age an image can be unused before it is garbage collected. // The default of this field is "0s", which disables this field--meaning images won't be garbage // collected based on being unused for too long. // Default: "0s" (disabled) // +optional ImageMaximumGCAge metav1.Duration `json:"imageMaximumGCAge,omitempty"` // imageGCHighThresholdPercent is the percent of disk usage after which // image garbage collection is always run. The percent is calculated by // dividing this field value by 100, so this field must be between 0 and // 100, inclusive. When specified, the value must be greater than // imageGCLowThresholdPercent. // Default: 85 // +optional ImageGCHighThresholdPercent *int32 `json:"imageGCHighThresholdPercent,omitempty"` // imageGCLowThresholdPercent is the percent of disk usage before which // image garbage collection is never run. Lowest disk usage to garbage // collect to. The percent is calculated by dividing this field value by 100, // so the field value must be between 0 and 100, inclusive. When specified, the // value must be less than imageGCHighThresholdPercent. // Default: 80 // +optional ImageGCLowThresholdPercent *int32 `json:"imageGCLowThresholdPercent,omitempty"` // volumeStatsAggPeriod is the frequency for calculating and caching volume // disk usage for all pods. // Default: "1m" // +optional VolumeStatsAggPeriod metav1.Duration `json:"volumeStatsAggPeriod,omitempty"` // kubeletCgroups is the absolute name of cgroups to isolate the kubelet in // Default: "" // +optional KubeletCgroups string `json:"kubeletCgroups,omitempty"` // systemCgroups is absolute name of cgroups in which to place // all non-kernel processes that are not already in a container. Empty // for no container. Rolling back the flag requires a reboot. // The cgroupRoot must be specified if this field is not empty. // Default: "" // +optional SystemCgroups string `json:"systemCgroups,omitempty"` // cgroupRoot is the root cgroup to use for pods. This is handled by the // container runtime on a best effort basis. // +optional CgroupRoot string `json:"cgroupRoot,omitempty"` // cgroupsPerQOS enable QoS based CGroup hierarchy: top level CGroups for QoS classes // and all Burstable and BestEffort Pods are brought up under their specific top level // QoS CGroup. // Default: true // +optional CgroupsPerQOS *bool `json:"cgroupsPerQOS,omitempty"` // cgroupDriver is the driver kubelet uses to manipulate CGroups on the host (cgroupfs // or systemd). // Default: "cgroupfs" // +optional CgroupDriver string `json:"cgroupDriver,omitempty"` // cpuManagerPolicy is the name of the policy to use. // Requires the CPUManager feature gate to be enabled. // Default: "None" // +optional CPUManagerPolicy string `json:"cpuManagerPolicy,omitempty"` // singleProcessOOMKill, if true, will prevent the `memory.oom.group` flag from being set for container // cgroups in cgroups v2. This causes processes in the container to be OOM killed individually instead of as // a group. It means that if true, the behavior aligns with the behavior of cgroups v1. // The default value is determined automatically when you don't specify. // On non-linux such as windows, only null / absent is allowed. // On cgroup v1 linux, only null / absent and true are allowed. // On cgroup v2 linux, null / absent, true and false are allowed. The default value is false. // +optional SingleProcessOOMKill *bool `json:"singleProcessOOMKill,omitempty"` // cpuManagerPolicyOptions is a set of key=value which allows to set extra options // to fine tune the behaviour of the cpu manager policies. // Requires both the "CPUManager" and "CPUManagerPolicyOptions" feature gates to be enabled. // Default: nil // +optional CPUManagerPolicyOptions map[string]string `json:"cpuManagerPolicyOptions,omitempty"` // cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager. // Requires the CPUManager feature gate to be enabled. // Default: "10s" // +optional CPUManagerReconcilePeriod metav1.Duration `json:"cpuManagerReconcilePeriod,omitempty"` // memoryManagerPolicy is the name of the policy to use by memory manager. // Requires the MemoryManager feature gate to be enabled. // Default: "none" // +optional MemoryManagerPolicy string `json:"memoryManagerPolicy,omitempty"` // topologyManagerPolicy is the name of the topology manager policy to use. // Valid values include: // // - `restricted`: kubelet only allows pods with optimal NUMA node alignment for // requested resources; // - `best-effort`: kubelet will favor pods with NUMA alignment of CPU and device // resources; // - `none`: kubelet has no knowledge of NUMA alignment of a pod's CPU and device resources. // - `single-numa-node`: kubelet only allows pods with a single NUMA alignment // of CPU and device resources. // // Default: "none" // +optional TopologyManagerPolicy string `json:"topologyManagerPolicy,omitempty"` // topologyManagerScope represents the scope of topology hint generation // that topology manager requests and hint providers generate. Valid values include: // // - `container`: topology policy is applied on a per-container basis. // - `pod`: topology policy is applied on a per-pod basis. // // Default: "container" // +optional TopologyManagerScope string `json:"topologyManagerScope,omitempty"` // TopologyManagerPolicyOptions is a set of key=value which allows to set extra options // to fine tune the behaviour of the topology manager policies. // Requires both the "TopologyManager" and "TopologyManagerPolicyOptions" feature gates to be enabled. // Default: nil // +optional TopologyManagerPolicyOptions map[string]string `json:"topologyManagerPolicyOptions,omitempty"` // qosReserved is a set of resource name to percentage pairs that specify // the minimum percentage of a resource reserved for exclusive use by the // guaranteed QoS tier. // Currently supported resources: "memory" // Requires the QOSReserved feature gate to be enabled. // Default: nil // +optional QOSReserved map[string]string `json:"qosReserved,omitempty"` // runtimeRequestTimeout is the timeout for all runtime requests except long running // requests - pull, logs, exec and attach. // Default: "2m" // +optional RuntimeRequestTimeout metav1.Duration `json:"runtimeRequestTimeout,omitempty"` // hairpinMode specifies how the Kubelet should configure the container // bridge for hairpin packets. // Setting this flag allows endpoints in a Service to loadbalance back to // themselves if they should try to access their own Service. Values: // // - "promiscuous-bridge": make the container bridge promiscuous. // - "hairpin-veth": set the hairpin flag on container veth interfaces. // - "none": do nothing. // // Generally, one must set `--hairpin-mode=hairpin-veth to` achieve hairpin NAT, // because promiscuous-bridge assumes the existence of a container bridge named cbr0. // Default: "promiscuous-bridge" // +optional HairpinMode string `json:"hairpinMode,omitempty"` // maxPods is the maximum number of Pods that can run on this Kubelet. // The value must be a non-negative integer. // Default: 110 // +optional MaxPods int32 `json:"maxPods,omitempty"` // podCIDR is the CIDR to use for pod IP addresses, only used in standalone mode. // In cluster mode, this is obtained from the control plane. // Default: "" // +optional PodCIDR string `json:"podCIDR,omitempty"` // podPidsLimit is the maximum number of PIDs in any pod. // Default: -1 // +optional PodPidsLimit *int64 `json:"podPidsLimit,omitempty"` // resolvConf is the resolver configuration file used as the basis // for the container DNS resolution configuration. // If set to the empty string, will override the default and effectively disable DNS lookups. // Default: "/etc/resolv.conf" // +optional ResolverConfig *string `json:"resolvConf,omitempty"` // runOnce causes the Kubelet to check the API server once for pods, // run those in addition to the pods specified by static pod files, and exit. // Default: false // +optional RunOnce bool `json:"runOnce,omitempty"` // cpuCFSQuota enables CPU CFS quota enforcement for containers that // specify CPU limits. // Default: true // +optional CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty"` // cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`. // The value must be between 1 ms and 1 second, inclusive. // Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled. // Default: "100ms" // +optional CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty"` // nodeStatusMaxImages caps the number of images reported in Node.status.images. // The value must be greater than -2. // Note: If -1 is specified, no cap will be applied. If 0 is specified, no image is returned. // Default: 50 // +optional NodeStatusMaxImages *int32 `json:"nodeStatusMaxImages,omitempty"` // maxOpenFiles is Number of files that can be opened by Kubelet process. // The value must be a non-negative number. // Default: 1000000 // +optional MaxOpenFiles int64 `json:"maxOpenFiles,omitempty"` // contentType is contentType of requests sent to apiserver. // Default: "application/vnd.kubernetes.protobuf" // +optional ContentType string `json:"contentType,omitempty"` // kubeAPIQPS is the QPS to use while talking with kubernetes apiserver. // Default: 50 // +optional KubeAPIQPS *int32 `json:"kubeAPIQPS,omitempty"` // kubeAPIBurst is the burst to allow while talking with kubernetes API server. // This field cannot be a negative number. // Default: 100 // +optional KubeAPIBurst int32 `json:"kubeAPIBurst,omitempty"` // serializeImagePulls when enabled, tells the Kubelet to pull images one // at a time. We recommend *not* changing the default value on nodes that // run docker daemon with version < 1.9 or an Aufs storage backend. // Issue #10959 has more details. // Default: true // +optional SerializeImagePulls *bool `json:"serializeImagePulls,omitempty"` // MaxParallelImagePulls sets the maximum number of image pulls in parallel. // This field cannot be set if SerializeImagePulls is true. // Setting it to nil means no limit. // Default: nil // +optional MaxParallelImagePulls *int32 `json:"maxParallelImagePulls,omitempty"` // evictionHard is a map of signal names to quantities that defines hard eviction // thresholds. For example: `{"memory.available": "300Mi"}`. // To explicitly disable, pass a 0% or 100% threshold on an arbitrary resource. // Default: // memory.available: "100Mi" // nodefs.available: "10%" // nodefs.inodesFree: "5%" // imagefs.available: "15%" // +optional EvictionHard map[string]string `json:"evictionHard,omitempty"` // evictionSoft is a map of signal names to quantities that defines soft eviction thresholds. // For example: `{"memory.available": "300Mi"}`. // Default: nil // +optional EvictionSoft map[string]string `json:"evictionSoft,omitempty"` // evictionSoftGracePeriod is a map of signal names to quantities that defines grace // periods for each soft eviction signal. For example: `{"memory.available": "30s"}`. // Default: nil // +optional EvictionSoftGracePeriod map[string]string `json:"evictionSoftGracePeriod,omitempty"` // evictionPressureTransitionPeriod is the duration for which the kubelet has to wait // before transitioning out of an eviction pressure condition. // Default: "5m" // +optional EvictionPressureTransitionPeriod metav1.Duration `json:"evictionPressureTransitionPeriod,omitempty"` // evictionMaxPodGracePeriod is the maximum allowed grace period (in seconds) to use // when terminating pods in response to a soft eviction threshold being met. This value // effectively caps the Pod's terminationGracePeriodSeconds value during soft evictions. // Default: 0 // +optional EvictionMaxPodGracePeriod int32 `json:"evictionMaxPodGracePeriod,omitempty"` // evictionMinimumReclaim is a map of signal names to quantities that defines minimum reclaims, // which describe the minimum amount of a given resource the kubelet will reclaim when // performing a pod eviction while that resource is under pressure. // For example: `{"imagefs.available": "2Gi"}`. // Default: nil // +optional EvictionMinimumReclaim map[string]string `json:"evictionMinimumReclaim,omitempty"` // podsPerCore is the maximum number of pods per core. Cannot exceed maxPods. // The value must be a non-negative integer. // If 0, there is no limit on the number of Pods. // Default: 0 // +optional PodsPerCore int32 `json:"podsPerCore,omitempty"` // enableControllerAttachDetach enables the Attach/Detach controller to // manage attachment/detachment of volumes scheduled to this node, and // disables kubelet from executing any attach/detach operations. // Note: attaching/detaching CSI volumes is not supported by the kubelet, // so this option needs to be true for that use case. // Default: true // +optional EnableControllerAttachDetach *bool `json:"enableControllerAttachDetach,omitempty"` // protectKernelDefaults, if true, causes the Kubelet to error if kernel // flags are not as it expects. Otherwise the Kubelet will attempt to modify // kernel flags to match its expectation. // Default: false // +optional ProtectKernelDefaults bool `json:"protectKernelDefaults,omitempty"` // makeIPTablesUtilChains, if true, causes the Kubelet to create the // KUBE-IPTABLES-HINT chain in iptables as a hint to other components about the // configuration of iptables on the system. // Default: true // +optional MakeIPTablesUtilChains *bool `json:"makeIPTablesUtilChains,omitempty"` // iptablesMasqueradeBit formerly controlled the creation of the KUBE-MARK-MASQ // chain. // Deprecated: no longer has any effect. // Default: 14 // +optional IPTablesMasqueradeBit *int32 `json:"iptablesMasqueradeBit,omitempty"` // iptablesDropBit formerly controlled the creation of the KUBE-MARK-DROP chain. // Deprecated: no longer has any effect. // Default: 15 // +optional IPTablesDropBit *int32 `json:"iptablesDropBit,omitempty"` // featureGates is a map of feature names to bools that enable or disable experimental // features. This field modifies piecemeal the built-in default values from // "k8s.io/kubernetes/pkg/features/kube_features.go". // Default: nil // +optional FeatureGates map[string]bool `json:"featureGates,omitempty"` // failSwapOn tells the Kubelet to fail to start if swap is enabled on the node. // Default: true // +optional FailSwapOn *bool `json:"failSwapOn,omitempty"` // memorySwap configures swap memory available to container workloads. // +featureGate=NodeSwap // +optional MemorySwap MemorySwapConfiguration `json:"memorySwap,omitempty"` // containerLogMaxSize is a quantity defining the maximum size of the container log // file before it is rotated. For example: "5Mi" or "256Ki". // Default: "10Mi" // +optional ContainerLogMaxSize string `json:"containerLogMaxSize,omitempty"` // containerLogMaxFiles specifies the maximum number of container log files that can // be present for a container. // Default: 5 // +optional ContainerLogMaxFiles *int32 `json:"containerLogMaxFiles,omitempty"` // ContainerLogMaxWorkers specifies the maximum number of concurrent workers to spawn // for performing the log rotate operations. Set this count to 1 for disabling the // concurrent log rotation workflows // Default: 1 // +optional ContainerLogMaxWorkers *int32 `json:"containerLogMaxWorkers,omitempty"` // ContainerLogMonitorInterval specifies the duration at which the container logs are monitored // for performing the log rotate operation. This defaults to 10 * time.Seconds. But can be // customized to a smaller value based on the log generation rate and the size required to be // rotated against // Default: 10s // +optional ContainerLogMonitorInterval *metav1.Duration `json:"containerLogMonitorInterval,omitempty"` // configMapAndSecretChangeDetectionStrategy is a mode in which ConfigMap and Secret // managers are running. Valid values include: // // - `Get`: kubelet fetches necessary objects directly from the API server; // - `Cache`: kubelet uses TTL cache for object fetched from the API server; // - `Watch`: kubelet uses watches to observe changes to objects that are in its interest. // // Default: "Watch" // +optional ConfigMapAndSecretChangeDetectionStrategy ResourceChangeDetectionStrategy `json:"configMapAndSecretChangeDetectionStrategy,omitempty"` /* the following fields are meant for Node Allocatable */ // systemReserved is a set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) // pairs that describe resources reserved for non-kubernetes components. // Currently only cpu and memory are supported. // See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources for more detail. // Default: nil // +optional SystemReserved map[string]string `json:"systemReserved,omitempty"` // kubeReserved is a set of ResourceName=ResourceQuantity (e.g. cpu=200m,memory=150G) pairs // that describe resources reserved for kubernetes system components. // Currently cpu, memory and local storage for root file system are supported. // See https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources // for more details. // Default: nil // +optional KubeReserved map[string]string `json:"kubeReserved,omitempty"` // The reservedSystemCPUs option specifies the CPU list reserved for the host // level system threads and kubernetes related threads. This provide a "static" // CPU list rather than the "dynamic" list by systemReserved and kubeReserved. // This option does not support systemReservedCgroup or kubeReservedCgroup. ReservedSystemCPUs string `json:"reservedSystemCPUs,omitempty"` // showHiddenMetricsForVersion is the previous version for which you want to show // hidden metrics. // Only the previous minor version is meaningful, other values will not be allowed. // The format is `.`, e.g.: `1.16`. // The purpose of this format is make sure you have the opportunity to notice // if the next release hides additional metrics, rather than being surprised // when they are permanently removed in the release after that. // Default: "" // +optional ShowHiddenMetricsForVersion string `json:"showHiddenMetricsForVersion,omitempty"` // systemReservedCgroup helps the kubelet identify absolute name of top level CGroup used // to enforce `systemReserved` compute resource reservation for OS system daemons. // Refer to [Node Allocatable](https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) // doc for more information. // Default: "" // +optional SystemReservedCgroup string `json:"systemReservedCgroup,omitempty"` // kubeReservedCgroup helps the kubelet identify absolute name of top level CGroup used // to enforce `KubeReserved` compute resource reservation for Kubernetes node system daemons. // Refer to [Node Allocatable](https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) // doc for more information. // Default: "" // +optional KubeReservedCgroup string `json:"kubeReservedCgroup,omitempty"` // This flag specifies the various Node Allocatable enforcements that Kubelet needs to perform. // This flag accepts a list of options. Acceptable options are `none`, `pods`, // `system-reserved` and `kube-reserved`. // If `none` is specified, no other options may be specified. // When `system-reserved` is in the list, systemReservedCgroup must be specified. // When `kube-reserved` is in the list, kubeReservedCgroup must be specified. // This field is supported only when `cgroupsPerQOS` is set to true. // Refer to [Node Allocatable](https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) // for more information. // Default: ["pods"] // +optional EnforceNodeAllocatable []string `json:"enforceNodeAllocatable,omitempty"` // A comma separated whitelist of unsafe sysctls or sysctl patterns (ending in `*`). // Unsafe sysctl groups are `kernel.shm*`, `kernel.msg*`, `kernel.sem`, `fs.mqueue.*`, // and `net.*`. For example: "`kernel.msg*,net.ipv4.route.min_pmtu`" // Default: [] // +optional AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` // volumePluginDir is the full path of the directory in which to search // for additional third party volume plugins. // Default: "/usr/libexec/kubernetes/kubelet-plugins/volume/exec/" // +optional VolumePluginDir string `json:"volumePluginDir,omitempty"` // providerID, if set, sets the unique ID of the instance that an external // provider (i.e. cloudprovider) can use to identify a specific node. // Default: "" // +optional ProviderID string `json:"providerID,omitempty"` // kernelMemcgNotification, if set, instructs the kubelet to integrate with the // kernel memcg notification for determining if memory eviction thresholds are // exceeded rather than polling. // Default: false // +optional KernelMemcgNotification bool `json:"kernelMemcgNotification,omitempty"` // logging specifies the options of logging. // Refer to [Logs Options](https://github.com/kubernetes/component-base/blob/master/logs/options.go) // for more information. // Default: // Format: text // + optional Logging logsapi.LoggingConfiguration `json:"logging,omitempty"` // enableSystemLogHandler enables system logs via web interface host:port/logs/ // Default: true // +optional EnableSystemLogHandler *bool `json:"enableSystemLogHandler,omitempty"` // enableSystemLogQuery enables the node log query feature on the /logs endpoint. // EnableSystemLogHandler has to be enabled in addition for this feature to work. // Enabling this feature has security implications. The recommendation is to enable it on a need basis for debugging // purposes and disabling otherwise. // Default: false // +featureGate=NodeLogQuery // +optional EnableSystemLogQuery *bool `json:"enableSystemLogQuery,omitempty"` // shutdownGracePeriod specifies the total duration that the node should delay the // shutdown and total grace period for pod termination during a node shutdown. // Default: "0s" // +featureGate=GracefulNodeShutdown // +optional ShutdownGracePeriod metav1.Duration `json:"shutdownGracePeriod,omitempty"` // shutdownGracePeriodCriticalPods specifies the duration used to terminate critical // pods during a node shutdown. This should be less than shutdownGracePeriod. // For example, if shutdownGracePeriod=30s, and shutdownGracePeriodCriticalPods=10s, // during a node shutdown the first 20 seconds would be reserved for gracefully // terminating normal pods, and the last 10 seconds would be reserved for terminating // critical pods. // Default: "0s" // +featureGate=GracefulNodeShutdown // +optional ShutdownGracePeriodCriticalPods metav1.Duration `json:"shutdownGracePeriodCriticalPods,omitempty"` // shutdownGracePeriodByPodPriority specifies the shutdown grace period for Pods based // on their associated priority class value. // When a shutdown request is received, the Kubelet will initiate shutdown on all pods // running on the node with a grace period that depends on the priority of the pod, // and then wait for all pods to exit. // Each entry in the array represents the graceful shutdown time a pod with a priority // class value that lies in the range of that value and the next higher entry in the // list when the node is shutting down. // For example, to allow critical pods 10s to shutdown, priority>=10000 pods 20s to // shutdown, and all remaining pods 30s to shutdown. // // shutdownGracePeriodByPodPriority: // - priority: 2000000000 // shutdownGracePeriodSeconds: 10 // - priority: 10000 // shutdownGracePeriodSeconds: 20 // - priority: 0 // shutdownGracePeriodSeconds: 30 // // The time the Kubelet will wait before exiting will at most be the maximum of all // shutdownGracePeriodSeconds for each priority class range represented on the node. // When all pods have exited or reached their grace periods, the Kubelet will release // the shutdown inhibit lock. // Requires the GracefulNodeShutdown feature gate to be enabled. // This configuration must be empty if either ShutdownGracePeriod or ShutdownGracePeriodCriticalPods is set. // Default: nil // +featureGate=GracefulNodeShutdownBasedOnPodPriority // +optional ShutdownGracePeriodByPodPriority []ShutdownGracePeriodByPodPriority `json:"shutdownGracePeriodByPodPriority,omitempty"` // CrashLoopBackOff contains config to modify node-level parameters for // container restart behavior // +featureGate=KubeletCrashLoopBackOffMax // +optional CrashLoopBackOff CrashLoopBackOffConfig `json:"crashLoopBackOff,omitempty"` // reservedMemory specifies a comma-separated list of memory reservations for NUMA nodes. // The parameter makes sense only in the context of the memory manager feature. // The memory manager will not allocate reserved memory for container workloads. // For example, if you have a NUMA0 with 10Gi of memory and the reservedMemory was // specified to reserve 1Gi of memory at NUMA0, the memory manager will assume that // only 9Gi is available for allocation. // You can specify a different amount of NUMA node and memory types. // You can omit this parameter at all, but you should be aware that the amount of // reserved memory from all NUMA nodes should be equal to the amount of memory specified // by the [node allocatable](https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable). // If at least one node allocatable parameter has a non-zero value, you will need // to specify at least one NUMA node. // Also, avoid specifying: // // 1. Duplicates, the same NUMA node, and memory type, but with a different value. // 2. zero limits for any memory type. // 3. NUMAs nodes IDs that do not exist under the machine. // 4. memory types except for memory and hugepages- // // Default: nil // +optional ReservedMemory []MemoryReservation `json:"reservedMemory,omitempty"` // enableProfilingHandler enables profiling via web interface host:port/debug/pprof/ // Default: true // +optional EnableProfilingHandler *bool `json:"enableProfilingHandler,omitempty"` // enableDebugFlagsHandler enables flags endpoint via web interface host:port/debug/flags/v // Default: true // +optional EnableDebugFlagsHandler *bool `json:"enableDebugFlagsHandler,omitempty"` // SeccompDefault enables the use of `RuntimeDefault` as the default seccomp profile for all workloads. // Default: false // +optional SeccompDefault *bool `json:"seccompDefault,omitempty"` // MemoryThrottlingFactor specifies the factor multiplied by the memory limit or node allocatable memory // when setting the cgroupv2 memory.high value to enforce MemoryQoS. // Decreasing this factor will set lower high limit for container cgroups and put heavier reclaim pressure // while increasing will put less reclaim pressure. // See https://kep.k8s.io/2570 for more details. // Default: 0.9 // +featureGate=MemoryQoS // +optional MemoryThrottlingFactor *float64 `json:"memoryThrottlingFactor,omitempty"` // registerWithTaints are an array of taints to add to a node object when // the kubelet registers itself. This only takes effect when registerNode // is true and upon the initial registration of the node. // Default: nil // +optional RegisterWithTaints []v1.Taint `json:"registerWithTaints,omitempty"` // registerNode enables automatic registration with the apiserver. // Default: true // +optional RegisterNode *bool `json:"registerNode,omitempty"` // 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"` // LocalStorageCapacityIsolation enables local ephemeral storage isolation feature. The default setting is true. // This feature allows users to set request/limit for container's ephemeral storage and manage it in a similar way // as cpu and memory. It also allows setting sizeLimit for emptyDir volume, which will trigger pod eviction if disk // usage from the volume exceeds the limit. // This feature depends on the capability of detecting correct root file system disk usage. For certain systems, // such as kind rootless, if this capability cannot be supported, the feature LocalStorageCapacityIsolation should be // disabled. Once disabled, user should not set request/limit for container's ephemeral storage, or sizeLimit for emptyDir. // Default: true // +optional LocalStorageCapacityIsolation *bool `json:"localStorageCapacityIsolation,omitempty"` // ContainerRuntimeEndpoint is the endpoint of container runtime. // Unix Domain Sockets are supported on Linux, while npipe and tcp endpoints are supported on Windows. // Examples:'unix:///path/to/runtime.sock', 'npipe:////./pipe/runtime' ContainerRuntimeEndpoint string `json:"containerRuntimeEndpoint"` // ImageServiceEndpoint is the endpoint of container image service. // Unix Domain Socket are supported on Linux, while npipe and tcp endpoints are supported on Windows. // Examples:'unix:///path/to/runtime.sock', 'npipe:////./pipe/runtime'. // If not specified, the value in containerRuntimeEndpoint is used. // +optional ImageServiceEndpoint string `json:"imageServiceEndpoint,omitempty"` // FailCgroupV1 prevents the kubelet from starting on hosts // that use cgroup v1. By default, this is set to 'false', meaning // the kubelet is allowed to start on cgroup v1 hosts unless this // option is explicitly enabled. // Default: false // +optional FailCgroupV1 *bool `json:"failCgroupV1,omitempty"` } type KubeletAuthorizationMode string const ( // KubeletAuthorizationModeAlwaysAllow authorizes all authenticated requests KubeletAuthorizationModeAlwaysAllow KubeletAuthorizationMode = "AlwaysAllow" // KubeletAuthorizationModeWebhook uses the SubjectAccessReview API to determine authorization KubeletAuthorizationModeWebhook KubeletAuthorizationMode = "Webhook" ) type KubeletAuthorization struct { // mode is the authorization mode to apply to requests to the kubelet server. // Valid values are `AlwaysAllow` and `Webhook`. // Webhook mode uses the SubjectAccessReview API to determine authorization. // +optional Mode KubeletAuthorizationMode `json:"mode,omitempty"` // webhook contains settings related to Webhook authorization. // +optional Webhook KubeletWebhookAuthorization `json:"webhook"` } type KubeletWebhookAuthorization struct { // cacheAuthorizedTTL is the duration to cache 'authorized' responses from the // webhook authorizer. // +optional CacheAuthorizedTTL metav1.Duration `json:"cacheAuthorizedTTL,omitempty"` // cacheUnauthorizedTTL is the duration to cache 'unauthorized' responses from // the webhook authorizer. // +optional CacheUnauthorizedTTL metav1.Duration `json:"cacheUnauthorizedTTL,omitempty"` } type KubeletAuthentication struct { // x509 contains settings related to x509 client certificate authentication. // +optional X509 KubeletX509Authentication `json:"x509"` // webhook contains settings related to webhook bearer token authentication. // +optional Webhook KubeletWebhookAuthentication `json:"webhook"` // anonymous contains settings related to anonymous authentication. // +optional Anonymous KubeletAnonymousAuthentication `json:"anonymous"` } type KubeletX509Authentication struct { // clientCAFile is the path to a PEM-encoded certificate bundle. If set, any request // presenting a client certificate signed by one of the authorities in the bundle // is authenticated with a username corresponding to the CommonName, // and groups corresponding to the Organization in the client certificate. // +optional ClientCAFile string `json:"clientCAFile,omitempty"` } type KubeletWebhookAuthentication struct { // enabled allows bearer token authentication backed by the // tokenreviews.authentication.k8s.io API. // +optional Enabled *bool `json:"enabled,omitempty"` // cacheTTL enables caching of authentication results // +optional CacheTTL metav1.Duration `json:"cacheTTL,omitempty"` } type KubeletAnonymousAuthentication struct { // enabled allows anonymous requests to the kubelet server. // Requests that are not rejected by another authentication method are treated as // anonymous requests. // Anonymous requests have a username of `system:anonymous`, and a group name of // `system:unauthenticated`. // +optional Enabled *bool `json:"enabled,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SerializedNodeConfigSource allows us to serialize v1.NodeConfigSource. // This type is used internally by the Kubelet for tracking checkpointed dynamic configs. // It exists in the kubeletconfig API group because it is classified as a versioned input to the Kubelet. type SerializedNodeConfigSource struct { metav1.TypeMeta `json:",inline"` // source is the source that we are serializing. // +optional Source v1.NodeConfigSource `json:"source,omitempty" protobuf:"bytes,1,opt,name=source"` } // MemoryReservation specifies the memory reservation of different types for each NUMA node type MemoryReservation struct { NumaNode int32 `json:"numaNode"` Limits v1.ResourceList `json:"limits"` } // ShutdownGracePeriodByPodPriority specifies the shutdown grace period for Pods based on their associated priority class value type ShutdownGracePeriodByPodPriority struct { // priority is the priority value associated with the shutdown grace period Priority int32 `json:"priority"` // shutdownGracePeriodSeconds is the shutdown grace period in seconds ShutdownGracePeriodSeconds int64 `json:"shutdownGracePeriodSeconds"` } type MemorySwapConfiguration struct { // swapBehavior configures swap memory available to container workloads. May be one of // "", "NoSwap": workloads can not use swap, default option. // "LimitedSwap": workload swap usage is limited. The swap limit is proportionate to the container's memory request. // +featureGate=NodeSwap // +optional SwapBehavior string `json:"swapBehavior,omitempty"` } type CrashLoopBackOffConfig struct { // maxContainerRestartPeriod is the maximum duration the backoff delay can accrue // to for container restarts, minimum 1 second, maximum 300 seconds. If not set, // defaults to the internal crashloopbackoff maximum (300s). // +featureGate=KubeletCrashLoopBackOffMax // +optional MaxContainerRestartPeriod *metav1.Duration `json:"maxContainerRestartPeriod,omitempty"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderConfig is the configuration containing information about // each exec credential provider. Kubelet reads this configuration from disk and enables // each provider as specified by the CredentialProvider type. type CredentialProviderConfig struct { metav1.TypeMeta `json:",inline"` // providers is a list of credential provider plugins that will be enabled by the kubelet. // Multiple providers may match against a single image, in which case credentials // from all providers will be returned to the kubelet. If multiple providers are called // for a single image, the results are combined. If providers return overlapping // auth keys, the value from the provider earlier in this list is used. Providers []CredentialProvider `json:"providers"` } // CredentialProvider represents an exec plugin to be invoked by the kubelet. The plugin is only // invoked when an image being pulled matches the images handled by the plugin (see matchImages). type CredentialProvider struct { // name is the required name of the credential provider. It must match the name of the // provider executable as seen by the kubelet. The executable must be in the kubelet's // bin directory (set by the --image-credential-provider-bin-dir flag). Name string `json:"name"` // matchImages is a required list of strings used to match against images in order to // determine if this provider should be invoked. If one of the strings matches the // requested image from the kubelet, the plugin will be invoked and given a chance // to provide credentials. Images are expected to contain the registry domain // and URL path. // // Each entry in matchImages is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // A match exists between an image and a matchImage when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // Example values of matchImages: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path MatchImages []string `json:"matchImages"` // defaultCacheDuration is the default duration the plugin will cache credentials in-memory // if a cache duration is not provided in the plugin response. This field is required. DefaultCacheDuration *metav1.Duration `json:"defaultCacheDuration"` // Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse // MUST use the same encoding version as the input. Current supported values are: // - credentialprovider.kubelet.k8s.io/v1beta1 APIVersion string `json:"apiVersion"` // Arguments to pass to the command when executing it. // +optional Args []string `json:"args,omitempty"` // Env defines additional environment variables to expose to the process. These // are unioned with the host's environment, as well as variables client-go uses // to pass argument to the plugin. // +optional Env []ExecEnvVar `json:"env,omitempty"` } // ExecEnvVar is used for setting environment variables when executing an exec-based // credential plugin. type ExecEnvVar struct { Name string `json:"name"` Value string `json:"value"` } kubelet-kubernetes-1.32.7/config/v1beta1/zz_generated.deepcopy.go000066400000000000000000000473321503561374700247570ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1beta1 import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" apiv1 "k8s.io/component-base/tracing/api/v1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CrashLoopBackOffConfig) DeepCopyInto(out *CrashLoopBackOffConfig) { *out = *in if in.MaxContainerRestartPeriod != nil { in, out := &in.MaxContainerRestartPeriod, &out.MaxContainerRestartPeriod *out = new(v1.Duration) **out = **in } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrashLoopBackOffConfig. func (in *CrashLoopBackOffConfig) DeepCopy() *CrashLoopBackOffConfig { if in == nil { return nil } out := new(CrashLoopBackOffConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProvider) DeepCopyInto(out *CredentialProvider) { *out = *in if in.MatchImages != nil { in, out := &in.MatchImages, &out.MatchImages *out = make([]string, len(*in)) copy(*out, *in) } if in.DefaultCacheDuration != nil { in, out := &in.DefaultCacheDuration, &out.DefaultCacheDuration *out = new(v1.Duration) **out = **in } if in.Args != nil { in, out := &in.Args, &out.Args *out = make([]string, len(*in)) copy(*out, *in) } if in.Env != nil { in, out := &in.Env, &out.Env *out = make([]ExecEnvVar, len(*in)) copy(*out, *in) } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProvider. func (in *CredentialProvider) DeepCopy() *CredentialProvider { if in == nil { return nil } out := new(CredentialProvider) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderConfig) DeepCopyInto(out *CredentialProviderConfig) { *out = *in out.TypeMeta = in.TypeMeta if in.Providers != nil { in, out := &in.Providers, &out.Providers *out = make([]CredentialProvider, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderConfig. func (in *CredentialProviderConfig) DeepCopy() *CredentialProviderConfig { if in == nil { return nil } out := new(CredentialProviderConfig) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderConfig) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ExecEnvVar) DeepCopyInto(out *ExecEnvVar) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExecEnvVar. func (in *ExecEnvVar) DeepCopy() *ExecEnvVar { if in == nil { return nil } out := new(ExecEnvVar) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletAnonymousAuthentication) DeepCopyInto(out *KubeletAnonymousAuthentication) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled *out = new(bool) **out = **in } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAnonymousAuthentication. func (in *KubeletAnonymousAuthentication) DeepCopy() *KubeletAnonymousAuthentication { if in == nil { return nil } out := new(KubeletAnonymousAuthentication) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletAuthentication) DeepCopyInto(out *KubeletAuthentication) { *out = *in out.X509 = in.X509 in.Webhook.DeepCopyInto(&out.Webhook) in.Anonymous.DeepCopyInto(&out.Anonymous) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAuthentication. func (in *KubeletAuthentication) DeepCopy() *KubeletAuthentication { if in == nil { return nil } out := new(KubeletAuthentication) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletAuthorization) DeepCopyInto(out *KubeletAuthorization) { *out = *in out.Webhook = in.Webhook return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAuthorization. func (in *KubeletAuthorization) DeepCopy() *KubeletAuthorization { if in == nil { return nil } out := new(KubeletAuthorization) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) { *out = *in out.TypeMeta = in.TypeMeta if in.EnableServer != nil { in, out := &in.EnableServer, &out.EnableServer *out = new(bool) **out = **in } out.SyncFrequency = in.SyncFrequency out.FileCheckFrequency = in.FileCheckFrequency out.HTTPCheckFrequency = in.HTTPCheckFrequency if in.StaticPodURLHeader != nil { in, out := &in.StaticPodURLHeader, &out.StaticPodURLHeader *out = make(map[string][]string, len(*in)) for key, val := range *in { var outVal []string if val == nil { (*out)[key] = nil } else { in, out := &val, &outVal *out = make([]string, len(*in)) copy(*out, *in) } (*out)[key] = outVal } } if in.TLSCipherSuites != nil { in, out := &in.TLSCipherSuites, &out.TLSCipherSuites *out = make([]string, len(*in)) copy(*out, *in) } in.Authentication.DeepCopyInto(&out.Authentication) out.Authorization = in.Authorization if in.RegistryPullQPS != nil { in, out := &in.RegistryPullQPS, &out.RegistryPullQPS *out = new(int32) **out = **in } if in.EventRecordQPS != nil { in, out := &in.EventRecordQPS, &out.EventRecordQPS *out = new(int32) **out = **in } if in.EnableDebuggingHandlers != nil { in, out := &in.EnableDebuggingHandlers, &out.EnableDebuggingHandlers *out = new(bool) **out = **in } if in.HealthzPort != nil { in, out := &in.HealthzPort, &out.HealthzPort *out = new(int32) **out = **in } if in.OOMScoreAdj != nil { in, out := &in.OOMScoreAdj, &out.OOMScoreAdj *out = new(int32) **out = **in } if in.ClusterDNS != nil { in, out := &in.ClusterDNS, &out.ClusterDNS *out = make([]string, len(*in)) copy(*out, *in) } out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency out.NodeStatusReportFrequency = in.NodeStatusReportFrequency out.ImageMinimumGCAge = in.ImageMinimumGCAge out.ImageMaximumGCAge = in.ImageMaximumGCAge if in.ImageGCHighThresholdPercent != nil { in, out := &in.ImageGCHighThresholdPercent, &out.ImageGCHighThresholdPercent *out = new(int32) **out = **in } if in.ImageGCLowThresholdPercent != nil { in, out := &in.ImageGCLowThresholdPercent, &out.ImageGCLowThresholdPercent *out = new(int32) **out = **in } out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod if in.CgroupsPerQOS != nil { in, out := &in.CgroupsPerQOS, &out.CgroupsPerQOS *out = new(bool) **out = **in } if in.SingleProcessOOMKill != nil { in, out := &in.SingleProcessOOMKill, &out.SingleProcessOOMKill *out = new(bool) **out = **in } if in.CPUManagerPolicyOptions != nil { in, out := &in.CPUManagerPolicyOptions, &out.CPUManagerPolicyOptions *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } out.CPUManagerReconcilePeriod = in.CPUManagerReconcilePeriod if in.TopologyManagerPolicyOptions != nil { in, out := &in.TopologyManagerPolicyOptions, &out.TopologyManagerPolicyOptions *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.QOSReserved != nil { in, out := &in.QOSReserved, &out.QOSReserved *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } out.RuntimeRequestTimeout = in.RuntimeRequestTimeout if in.PodPidsLimit != nil { in, out := &in.PodPidsLimit, &out.PodPidsLimit *out = new(int64) **out = **in } if in.ResolverConfig != nil { in, out := &in.ResolverConfig, &out.ResolverConfig *out = new(string) **out = **in } if in.CPUCFSQuota != nil { in, out := &in.CPUCFSQuota, &out.CPUCFSQuota *out = new(bool) **out = **in } if in.CPUCFSQuotaPeriod != nil { in, out := &in.CPUCFSQuotaPeriod, &out.CPUCFSQuotaPeriod *out = new(v1.Duration) **out = **in } if in.NodeStatusMaxImages != nil { in, out := &in.NodeStatusMaxImages, &out.NodeStatusMaxImages *out = new(int32) **out = **in } if in.KubeAPIQPS != nil { in, out := &in.KubeAPIQPS, &out.KubeAPIQPS *out = new(int32) **out = **in } if in.SerializeImagePulls != nil { in, out := &in.SerializeImagePulls, &out.SerializeImagePulls *out = new(bool) **out = **in } if in.MaxParallelImagePulls != nil { in, out := &in.MaxParallelImagePulls, &out.MaxParallelImagePulls *out = new(int32) **out = **in } if in.EvictionHard != nil { in, out := &in.EvictionHard, &out.EvictionHard *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.EvictionSoft != nil { in, out := &in.EvictionSoft, &out.EvictionSoft *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.EvictionSoftGracePeriod != nil { in, out := &in.EvictionSoftGracePeriod, &out.EvictionSoftGracePeriod *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod if in.EvictionMinimumReclaim != nil { in, out := &in.EvictionMinimumReclaim, &out.EvictionMinimumReclaim *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.EnableControllerAttachDetach != nil { in, out := &in.EnableControllerAttachDetach, &out.EnableControllerAttachDetach *out = new(bool) **out = **in } if in.MakeIPTablesUtilChains != nil { in, out := &in.MakeIPTablesUtilChains, &out.MakeIPTablesUtilChains *out = new(bool) **out = **in } if in.IPTablesMasqueradeBit != nil { in, out := &in.IPTablesMasqueradeBit, &out.IPTablesMasqueradeBit *out = new(int32) **out = **in } if in.IPTablesDropBit != nil { in, out := &in.IPTablesDropBit, &out.IPTablesDropBit *out = new(int32) **out = **in } if in.FeatureGates != nil { in, out := &in.FeatureGates, &out.FeatureGates *out = make(map[string]bool, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.FailSwapOn != nil { in, out := &in.FailSwapOn, &out.FailSwapOn *out = new(bool) **out = **in } out.MemorySwap = in.MemorySwap if in.ContainerLogMaxFiles != nil { in, out := &in.ContainerLogMaxFiles, &out.ContainerLogMaxFiles *out = new(int32) **out = **in } if in.ContainerLogMaxWorkers != nil { in, out := &in.ContainerLogMaxWorkers, &out.ContainerLogMaxWorkers *out = new(int32) **out = **in } if in.ContainerLogMonitorInterval != nil { in, out := &in.ContainerLogMonitorInterval, &out.ContainerLogMonitorInterval *out = new(v1.Duration) **out = **in } if in.SystemReserved != nil { in, out := &in.SystemReserved, &out.SystemReserved *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.KubeReserved != nil { in, out := &in.KubeReserved, &out.KubeReserved *out = make(map[string]string, len(*in)) for key, val := range *in { (*out)[key] = val } } if in.EnforceNodeAllocatable != nil { in, out := &in.EnforceNodeAllocatable, &out.EnforceNodeAllocatable *out = make([]string, len(*in)) copy(*out, *in) } if in.AllowedUnsafeSysctls != nil { in, out := &in.AllowedUnsafeSysctls, &out.AllowedUnsafeSysctls *out = make([]string, len(*in)) copy(*out, *in) } in.Logging.DeepCopyInto(&out.Logging) if in.EnableSystemLogHandler != nil { in, out := &in.EnableSystemLogHandler, &out.EnableSystemLogHandler *out = new(bool) **out = **in } if in.EnableSystemLogQuery != nil { in, out := &in.EnableSystemLogQuery, &out.EnableSystemLogQuery *out = new(bool) **out = **in } out.ShutdownGracePeriod = in.ShutdownGracePeriod out.ShutdownGracePeriodCriticalPods = in.ShutdownGracePeriodCriticalPods if in.ShutdownGracePeriodByPodPriority != nil { in, out := &in.ShutdownGracePeriodByPodPriority, &out.ShutdownGracePeriodByPodPriority *out = make([]ShutdownGracePeriodByPodPriority, len(*in)) copy(*out, *in) } in.CrashLoopBackOff.DeepCopyInto(&out.CrashLoopBackOff) if in.ReservedMemory != nil { in, out := &in.ReservedMemory, &out.ReservedMemory *out = make([]MemoryReservation, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.EnableProfilingHandler != nil { in, out := &in.EnableProfilingHandler, &out.EnableProfilingHandler *out = new(bool) **out = **in } if in.EnableDebugFlagsHandler != nil { in, out := &in.EnableDebugFlagsHandler, &out.EnableDebugFlagsHandler *out = new(bool) **out = **in } if in.SeccompDefault != nil { in, out := &in.SeccompDefault, &out.SeccompDefault *out = new(bool) **out = **in } if in.MemoryThrottlingFactor != nil { in, out := &in.MemoryThrottlingFactor, &out.MemoryThrottlingFactor *out = new(float64) **out = **in } if in.RegisterWithTaints != nil { in, out := &in.RegisterWithTaints, &out.RegisterWithTaints *out = make([]corev1.Taint, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.RegisterNode != nil { in, out := &in.RegisterNode, &out.RegisterNode *out = new(bool) **out = **in } if in.Tracing != nil { in, out := &in.Tracing, &out.Tracing *out = new(apiv1.TracingConfiguration) (*in).DeepCopyInto(*out) } if in.LocalStorageCapacityIsolation != nil { in, out := &in.LocalStorageCapacityIsolation, &out.LocalStorageCapacityIsolation *out = new(bool) **out = **in } if in.FailCgroupV1 != nil { in, out := &in.FailCgroupV1, &out.FailCgroupV1 *out = new(bool) **out = **in } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletConfiguration. func (in *KubeletConfiguration) DeepCopy() *KubeletConfiguration { if in == nil { return nil } out := new(KubeletConfiguration) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *KubeletConfiguration) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletWebhookAuthentication) DeepCopyInto(out *KubeletWebhookAuthentication) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled *out = new(bool) **out = **in } out.CacheTTL = in.CacheTTL return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletWebhookAuthentication. func (in *KubeletWebhookAuthentication) DeepCopy() *KubeletWebhookAuthentication { if in == nil { return nil } out := new(KubeletWebhookAuthentication) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletWebhookAuthorization) DeepCopyInto(out *KubeletWebhookAuthorization) { *out = *in out.CacheAuthorizedTTL = in.CacheAuthorizedTTL out.CacheUnauthorizedTTL = in.CacheUnauthorizedTTL return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletWebhookAuthorization. func (in *KubeletWebhookAuthorization) DeepCopy() *KubeletWebhookAuthorization { if in == nil { return nil } out := new(KubeletWebhookAuthorization) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubeletX509Authentication) DeepCopyInto(out *KubeletX509Authentication) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletX509Authentication. func (in *KubeletX509Authentication) DeepCopy() *KubeletX509Authentication { if in == nil { return nil } out := new(KubeletX509Authentication) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemoryReservation) DeepCopyInto(out *MemoryReservation) { *out = *in if in.Limits != nil { in, out := &in.Limits, &out.Limits *out = make(corev1.ResourceList, len(*in)) for key, val := range *in { (*out)[key] = val.DeepCopy() } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemoryReservation. func (in *MemoryReservation) DeepCopy() *MemoryReservation { if in == nil { return nil } out := new(MemoryReservation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemorySwapConfiguration) DeepCopyInto(out *MemorySwapConfiguration) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemorySwapConfiguration. func (in *MemorySwapConfiguration) DeepCopy() *MemorySwapConfiguration { if in == nil { return nil } out := new(MemorySwapConfiguration) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SerializedNodeConfigSource) DeepCopyInto(out *SerializedNodeConfigSource) { *out = *in out.TypeMeta = in.TypeMeta in.Source.DeepCopyInto(&out.Source) return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SerializedNodeConfigSource. func (in *SerializedNodeConfigSource) DeepCopy() *SerializedNodeConfigSource { if in == nil { return nil } out := new(SerializedNodeConfigSource) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *SerializedNodeConfigSource) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ShutdownGracePeriodByPodPriority) DeepCopyInto(out *ShutdownGracePeriodByPodPriority) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShutdownGracePeriodByPodPriority. func (in *ShutdownGracePeriodByPodPriority) DeepCopy() *ShutdownGracePeriodByPodPriority { if in == nil { return nil } out := new(ShutdownGracePeriodByPodPriority) in.DeepCopyInto(out) return out } kubelet-kubernetes-1.32.7/doc.go000066400000000000000000000011461503561374700165150ustar00rootroot00000000000000/* Copyright 2021 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 kubelet // import "k8s.io/kubelet" kubelet-kubernetes-1.32.7/go.mod000066400000000000000000000050211503561374700165230ustar00rootroot00000000000000// This is a generated file. Do not edit directly. module k8s.io/kubelet go 1.23.0 godebug default=go1.23 godebug winsymlink=0 require ( github.com/emicklei/go-restful/v3 v3.11.0 github.com/gogo/protobuf v1.3.2 github.com/stretchr/testify v1.9.0 google.golang.org/grpc v1.65.0 k8s.io/api v0.32.7 k8s.io/apimachinery v0.32.7 k8s.io/apiserver v0.32.7 k8s.io/client-go v0.32.7 k8s.io/component-base v0.32.7 k8s.io/cri-api v0.32.7 k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 ) require ( github.com/beorn7/perks v1.0.1 // indirect 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.2-0.20180830191138-d8f796af33cc // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kr/text v0.2.0 // indirect github.com/moby/spdystream v0.5.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.1 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect go.opentelemetry.io/otel v1.28.0 // indirect go.opentelemetry.io/otel/trace v1.28.0 // indirect golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.25.0 // indirect golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.7.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 // indirect google.golang.org/protobuf v1.35.1 // 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/structured-merge-diff/v4 v4.4.2 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) kubelet-kubernetes-1.32.7/go.sum000066400000000000000000000404621503561374700165600ustar00rootroot00000000000000github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/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.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= 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-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= 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.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgYQBbFN4U4JNXUNYpxael3UzMyo= github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.19.1 h1:wZWJDwK+NameRJuPGDhlnFgx8e8HN3XHQeLaYJFJBOE= github.com/prometheus/client_golang v1.19.1/go.mod h1:mP78NwGzrVks5S2H6ab8+ZZGJLZUq1hoULYBAYBw1Ho= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= 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= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7 h1:2035KHhUv+EpyB+hWgJnaWKJOdX1E95w2S8Rr4uWKTs= google.golang.org/genproto/googleapis/rpc v0.0.0-20240826202546-f6391c0de4c7/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= 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.32.7 h1:CBhHkoi3YJW8QQI6VL/Hu9f1HHVImmuIh513d4H4VfQ= k8s.io/api v0.32.7/go.mod h1:YEB46LZ/M0/9t0m+R2FxW5fkZAUR/eoS6sZQKS3mBYk= k8s.io/apimachinery v0.32.7 h1:1vTegNQIfM7dvZrMV5//6jJv2odKAnadv9Bg+doJmaA= k8s.io/apimachinery v0.32.7/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= k8s.io/apiserver v0.32.7 h1:BJADFQpbKM1LC5GTueefdnDjzu5PUXAcEgWZrs2gj18= k8s.io/apiserver v0.32.7/go.mod h1:a3O36FgT3dQ26oufk9/1VVmWcna/OLQjofirYiocfQI= k8s.io/client-go v0.32.7 h1:ZDhv3JTaQ/IejnNXRePBZdRecAEvxf8+pFdt/ruuWXc= k8s.io/client-go v0.32.7/go.mod h1:/he4Akuzee/lTiWmcsrpZfCQ2LPNLTC2qqumLVAw/Fw= k8s.io/component-base v0.32.7 h1:iXfcDveIsx0CyB0b8qo0/4pfgmhwshaO/u4ij1hZeAM= k8s.io/component-base v0.32.7/go.mod h1:Qfa6+z8IIyIdyqewerOlWaibCsxKbpBNd3ATNrPKe/A= k8s.io/cri-api v0.32.7 h1:y9uecUIxheAqEqfyuyTfEW9zV7HIMxA8ABG+vqyTQlc= k8s.io/cri-api v0.32.7/go.mod h1:DCzMuTh2padoinefWME0G678Mc3QFbLMF2vEweGzBAI= 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-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/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/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= kubelet-kubernetes-1.32.7/pkg/000077500000000000000000000000001503561374700162005ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/000077500000000000000000000000001503561374700171345ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/000077500000000000000000000000001503561374700230215ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/OWNERS000066400000000000000000000003471503561374700237650ustar00rootroot00000000000000# 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 kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/doc.go000066400000000000000000000013331503561374700241150ustar00rootroot00000000000000/* Copyright 2020 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. */ // +k8s:deepcopy-gen=package // +groupName=credentialprovider.kubelet.k8s.io package credentialprovider // import "k8s.io/kubelet/pkg/apis/credentialprovider" kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/install/000077500000000000000000000000001503561374700244675ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/install/install.go000066400000000000000000000026301503561374700264650ustar00rootroot00000000000000/* Copyright 2020 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 install import ( "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/kubelet/pkg/apis/credentialprovider" v1 "k8s.io/kubelet/pkg/apis/credentialprovider/v1" "k8s.io/kubelet/pkg/apis/credentialprovider/v1alpha1" "k8s.io/kubelet/pkg/apis/credentialprovider/v1beta1" ) // Install registers the credentialprovider.kubelet.k8s.io APIs into the given scheme. func Install(scheme *runtime.Scheme) { utilruntime.Must(credentialprovider.AddToScheme(scheme)) utilruntime.Must(v1alpha1.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1alpha1.SchemeGroupVersion)) utilruntime.Must(v1beta1.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion)) utilruntime.Must(v1.AddToScheme(scheme)) utilruntime.Must(scheme.SetVersionPriority(v1.SchemeGroupVersion)) } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/register.go000066400000000000000000000023411503561374700251740ustar00rootroot00000000000000/* Copyright 2020 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 credentialprovider import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "credentialprovider.kubelet.k8s.io" // SchemeGroupVersion is group version used to register these objects var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderRequest{}, &CredentialProviderResponse{}, ) return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/types.go000066400000000000000000000125621503561374700245220ustar00rootroot00000000000000/* Copyright 2020 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 credentialprovider import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderRequest includes the image that the kubelet requires authentication for. // Kubelet will pass this request object to the plugin via stdin. In general, plugins should // prefer responding with the same apiVersion they were sent. type CredentialProviderRequest struct { metav1.TypeMeta // image is the container image that is being pulled as part of the // credential provider plugin request. Plugins may optionally parse the image // to extract any information required to fetch credentials. Image string } type PluginCacheKeyType string const ( // ImagePluginCacheKeyType means the kubelet will cache credentials on a per-image basis, // using the image passed from the kubelet directly as the cache key. This includes // the registry domain, port (if specified), and path but does not include tags or SHAs. ImagePluginCacheKeyType PluginCacheKeyType = "Image" // RegistryPluginCacheKeyType means the kubelet will cache credentials on a per-registry basis. // The cache key will be based on the registry domain and port (if present) parsed from the requested image. RegistryPluginCacheKeyType PluginCacheKeyType = "Registry" // GlobalPluginCacheKeyType means the kubelet will cache credentials for all images that // match for a given plugin. This cache key should only be returned by plugins that do not use // the image input at all. GlobalPluginCacheKeyType PluginCacheKeyType = "Global" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderResponse holds credentials that the kubelet should use for the specified // image provided in the original request. Kubelet will read the response from the plugin via stdout. // This response should be set to the same apiVersion as CredentialProviderRequest. type CredentialProviderResponse struct { metav1.TypeMeta // cacheKeyType indiciates the type of caching key to use based on the image provided // in the request. There are three valid values for the cache key type: Image, Registry, and // Global. If an invalid value is specified, the response will NOT be used by the kubelet. CacheKeyType PluginCacheKeyType // cacheDuration indicates the duration the provided credentials should be cached for. // The kubelet will use this field to set the in-memory cache duration for credentials // in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in // CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig. // +optional CacheDuration *metav1.Duration // auth is a map containing authentication information passed into the kubelet. // Each key is a match image string (more on this below). The corresponding authConfig value // should be valid for all images that match against this key. A plugin should set // this field to null if no valid credentials can be returned for the requested image. // // Each key in the map is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // The kubelet will match images against the key when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // When multiple keys are returned, the kubelet will traverse all keys in reverse order so that: // - longer keys come before shorter keys with the same prefix // - non-wildcard keys come before wildcard keys with the same prefix. // // For any given match, the kubelet will attempt an image pull with the provided credentials, // stopping after the first successfully authenticated pull. // // Example keys: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path // +optional Auth map[string]AuthConfig } // AuthConfig contains authentication information for a container registry. // Only username/password based authentication is supported today, but more authentication // mechanisms may be added in the future. type AuthConfig struct { // username is the username used for authenticating to the container registry // An empty username is valid. Username string // password is the password used for authenticating to the container registry // An empty password is valid. Password string } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/000077500000000000000000000000001503561374700233475ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/doc.go000066400000000000000000000014571503561374700244520ustar00rootroot00000000000000/* Copyright 2022 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. */ // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/credentialprovider // +k8s:defaulter-gen=TypeMeta // +groupName=credentialprovider.kubelet.k8s.io package v1 // import "k8s.io/kubelet/pkg/apis/credentialprovider/v1" kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/register.go000066400000000000000000000025121503561374700255220ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "credentialprovider.kubelet.k8s.io" // SchemeGroupVersion is group version used to register these objects var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} localSchemeBuilder = &SchemeBuilder ) var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderRequest{}, &CredentialProviderResponse{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/types.go000066400000000000000000000130061503561374700250420ustar00rootroot00000000000000/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderRequest includes the image that the kubelet requires authentication for. // Kubelet will pass this request object to the plugin via stdin. In general, plugins should // prefer responding with the same apiVersion they were sent. type CredentialProviderRequest struct { metav1.TypeMeta `json:",inline"` // image is the container image that is being pulled as part of the // credential provider plugin request. Plugins may optionally parse the image // to extract any information required to fetch credentials. Image string `json:"image"` } type PluginCacheKeyType string const ( // ImagePluginCacheKeyType means the kubelet will cache credentials on a per-image basis, // using the image passed from the kubelet directly as the cache key. This includes // the registry domain, port (if specified), and path but does not include tags or SHAs. ImagePluginCacheKeyType PluginCacheKeyType = "Image" // RegistryPluginCacheKeyType means the kubelet will cache credentials on a per-registry basis. // The cache key will be based on the registry domain and port (if present) parsed from the requested image. RegistryPluginCacheKeyType PluginCacheKeyType = "Registry" // GlobalPluginCacheKeyType means the kubelet will cache credentials for all images that // match for a given plugin. This cache key should only be returned by plugins that do not use // the image input at all. GlobalPluginCacheKeyType PluginCacheKeyType = "Global" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderResponse holds credentials that the kubelet should use for the specified // image provided in the original request. Kubelet will read the response from the plugin via stdout. // This response should be set to the same apiVersion as CredentialProviderRequest. type CredentialProviderResponse struct { metav1.TypeMeta `json:",inline"` // cacheKeyType indiciates the type of caching key to use based on the image provided // in the request. There are three valid values for the cache key type: Image, Registry, and // Global. If an invalid value is specified, the response will NOT be used by the kubelet. CacheKeyType PluginCacheKeyType `json:"cacheKeyType"` // cacheDuration indicates the duration the provided credentials should be cached for. // The kubelet will use this field to set the in-memory cache duration for credentials // in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in // CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig. // +optional CacheDuration *metav1.Duration `json:"cacheDuration,omitempty"` // auth is a map containing authentication information passed into the kubelet. // Each key is a match image string (more on this below). The corresponding authConfig value // should be valid for all images that match against this key. A plugin should set // this field to null if no valid credentials can be returned for the requested image. // // Each key in the map is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // The kubelet will match images against the key when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // When multiple keys are returned, the kubelet will traverse all keys in reverse order so that: // - longer keys come before shorter keys with the same prefix // - non-wildcard keys come before wildcard keys with the same prefix. // // For any given match, the kubelet will attempt an image pull with the provided credentials, // stopping after the first successfully authenticated pull. // // Example keys: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path // +optional Auth map[string]AuthConfig `json:"auth,omitempty"` } // AuthConfig contains authentication information for a container registry. // Only username/password based authentication is supported today, but more authentication // mechanisms may be added in the future. type AuthConfig struct { // username is the username used for authenticating to the container registry // An empty username is valid. Username string `json:"username"` // password is the password used for authenticating to the container registry // An empty password is valid. Password string `json:"password"` } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/zz_generated.conversion.go000066400000000000000000000167151503561374700305550ustar00rootroot00000000000000//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 v1 import ( unsafe "unsafe" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" credentialprovider "k8s.io/kubelet/pkg/apis/credentialprovider" ) 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((*AuthConfig)(nil), (*credentialprovider.AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_AuthConfig_To_credentialprovider_AuthConfig(a.(*AuthConfig), b.(*credentialprovider.AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.AuthConfig)(nil), (*AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_AuthConfig_To_v1_AuthConfig(a.(*credentialprovider.AuthConfig), b.(*AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderRequest)(nil), (*credentialprovider.CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(a.(*CredentialProviderRequest), b.(*credentialprovider.CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderRequest)(nil), (*CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderRequest_To_v1_CredentialProviderRequest(a.(*credentialprovider.CredentialProviderRequest), b.(*CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderResponse)(nil), (*credentialprovider.CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(a.(*CredentialProviderResponse), b.(*credentialprovider.CredentialProviderResponse), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderResponse)(nil), (*CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderResponse_To_v1_CredentialProviderResponse(a.(*credentialprovider.CredentialProviderResponse), b.(*CredentialProviderResponse), scope) }); err != nil { return err } return nil } func autoConvert_v1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_v1_AuthConfig_To_credentialprovider_AuthConfig is an autogenerated conversion function. func Convert_v1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { return autoConvert_v1_AuthConfig_To_credentialprovider_AuthConfig(in, out, s) } func autoConvert_credentialprovider_AuthConfig_To_v1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_credentialprovider_AuthConfig_To_v1_AuthConfig is an autogenerated conversion function. func Convert_credentialprovider_AuthConfig_To_v1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { return autoConvert_credentialprovider_AuthConfig_To_v1_AuthConfig(in, out, s) } func autoConvert_v1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_v1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest is an autogenerated conversion function. func Convert_v1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { return autoConvert_v1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in, out, s) } func autoConvert_credentialprovider_CredentialProviderRequest_To_v1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_credentialprovider_CredentialProviderRequest_To_v1_CredentialProviderRequest is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderRequest_To_v1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderRequest_To_v1_CredentialProviderRequest(in, out, s) } func autoConvert_v1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = credentialprovider.PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*metav1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]credentialprovider.AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_v1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse is an autogenerated conversion function. func Convert_v1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { return autoConvert_v1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in, out, s) } func autoConvert_credentialprovider_CredentialProviderResponse_To_v1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*metav1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_credentialprovider_CredentialProviderResponse_To_v1_CredentialProviderResponse is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderResponse_To_v1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderResponse_To_v1_CredentialProviderResponse(in, out, s) } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/zz_generated.deepcopy.go000066400000000000000000000060471503561374700301750ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig. func (in *AuthConfig) DeepCopy() *AuthConfig { if in == nil { return nil } out := new(AuthConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderRequest) DeepCopyInto(out *CredentialProviderRequest) { *out = *in out.TypeMeta = in.TypeMeta return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderRequest. func (in *CredentialProviderRequest) DeepCopy() *CredentialProviderRequest { if in == nil { return nil } out := new(CredentialProviderRequest) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderResponse) DeepCopyInto(out *CredentialProviderResponse) { *out = *in out.TypeMeta = in.TypeMeta if in.CacheDuration != nil { in, out := &in.CacheDuration, &out.CacheDuration *out = new(metav1.Duration) **out = **in } if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = make(map[string]AuthConfig, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderResponse. func (in *CredentialProviderResponse) DeepCopy() *CredentialProviderResponse { if in == nil { return nil } out := new(CredentialProviderResponse) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderResponse) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1/zz_generated.defaults.go000066400000000000000000000017571503561374700301770ustar00rootroot00000000000000//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 defaulter-gen. DO NOT EDIT. package v1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/000077500000000000000000000000001503561374700244365ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/doc.go000066400000000000000000000014731503561374700255370ustar00rootroot00000000000000/* Copyright 2020 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. */ // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/credentialprovider // +k8s:defaulter-gen=TypeMeta // +groupName=credentialprovider.kubelet.k8s.io package v1alpha1 // import "k8s.io/kubelet/pkg/apis/credentialprovider/v1alpha1" kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/register.go000066400000000000000000000025261503561374700266160ustar00rootroot00000000000000/* Copyright 2020 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 v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "credentialprovider.kubelet.k8s.io" // SchemeGroupVersion is group version used to register these objects var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} localSchemeBuilder = &SchemeBuilder ) var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderRequest{}, &CredentialProviderResponse{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/types.go000066400000000000000000000130141503561374700261300ustar00rootroot00000000000000/* Copyright 2020 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 v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderRequest includes the image that the kubelet requires authentication for. // Kubelet will pass this request object to the plugin via stdin. In general, plugins should // prefer responding with the same apiVersion they were sent. type CredentialProviderRequest struct { metav1.TypeMeta `json:",inline"` // image is the container image that is being pulled as part of the // credential provider plugin request. Plugins may optionally parse the image // to extract any information required to fetch credentials. Image string `json:"image"` } type PluginCacheKeyType string const ( // ImagePluginCacheKeyType means the kubelet will cache credentials on a per-image basis, // using the image passed from the kubelet directly as the cache key. This includes // the registry domain, port (if specified), and path but does not include tags or SHAs. ImagePluginCacheKeyType PluginCacheKeyType = "Image" // RegistryPluginCacheKeyType means the kubelet will cache credentials on a per-registry basis. // The cache key will be based on the registry domain and port (if present) parsed from the requested image. RegistryPluginCacheKeyType PluginCacheKeyType = "Registry" // GlobalPluginCacheKeyType means the kubelet will cache credentials for all images that // match for a given plugin. This cache key should only be returned by plugins that do not use // the image input at all. GlobalPluginCacheKeyType PluginCacheKeyType = "Global" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderResponse holds credentials that the kubelet should use for the specified // image provided in the original request. Kubelet will read the response from the plugin via stdout. // This response should be set to the same apiVersion as CredentialProviderRequest. type CredentialProviderResponse struct { metav1.TypeMeta `json:",inline"` // cacheKeyType indiciates the type of caching key to use based on the image provided // in the request. There are three valid values for the cache key type: Image, Registry, and // Global. If an invalid value is specified, the response will NOT be used by the kubelet. CacheKeyType PluginCacheKeyType `json:"cacheKeyType"` // cacheDuration indicates the duration the provided credentials should be cached for. // The kubelet will use this field to set the in-memory cache duration for credentials // in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in // CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig. // +optional CacheDuration *metav1.Duration `json:"cacheDuration,omitempty"` // auth is a map containing authentication information passed into the kubelet. // Each key is a match image string (more on this below). The corresponding authConfig value // should be valid for all images that match against this key. A plugin should set // this field to null if no valid credentials can be returned for the requested image. // // Each key in the map is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // The kubelet will match images against the key when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // When multiple keys are returned, the kubelet will traverse all keys in reverse order so that: // - longer keys come before shorter keys with the same prefix // - non-wildcard keys come before wildcard keys with the same prefix. // // For any given match, the kubelet will attempt an image pull with the provided credentials, // stopping after the first successfully authenticated pull. // // Example keys: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path // +optional Auth map[string]AuthConfig `json:"auth,omitempty"` } // AuthConfig contains authentication information for a container registry. // Only username/password based authentication is supported today, but more authentication // mechanisms may be added in the future. type AuthConfig struct { // username is the username used for authenticating to the container registry // An empty username is valid. Username string `json:"username"` // password is the password used for authenticating to the container registry // An empty password is valid. Password string `json:"password"` } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/zz_generated.conversion.go000066400000000000000000000171731503561374700316430ustar00rootroot00000000000000//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 v1alpha1 import ( unsafe "unsafe" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" credentialprovider "k8s.io/kubelet/pkg/apis/credentialprovider" ) 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((*AuthConfig)(nil), (*credentialprovider.AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_AuthConfig_To_credentialprovider_AuthConfig(a.(*AuthConfig), b.(*credentialprovider.AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.AuthConfig)(nil), (*AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_AuthConfig_To_v1alpha1_AuthConfig(a.(*credentialprovider.AuthConfig), b.(*AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderRequest)(nil), (*credentialprovider.CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(a.(*CredentialProviderRequest), b.(*credentialprovider.CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderRequest)(nil), (*CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderRequest_To_v1alpha1_CredentialProviderRequest(a.(*credentialprovider.CredentialProviderRequest), b.(*CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderResponse)(nil), (*credentialprovider.CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(a.(*CredentialProviderResponse), b.(*credentialprovider.CredentialProviderResponse), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderResponse)(nil), (*CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderResponse_To_v1alpha1_CredentialProviderResponse(a.(*credentialprovider.CredentialProviderResponse), b.(*CredentialProviderResponse), scope) }); err != nil { return err } return nil } func autoConvert_v1alpha1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_v1alpha1_AuthConfig_To_credentialprovider_AuthConfig is an autogenerated conversion function. func Convert_v1alpha1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { return autoConvert_v1alpha1_AuthConfig_To_credentialprovider_AuthConfig(in, out, s) } func autoConvert_credentialprovider_AuthConfig_To_v1alpha1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_credentialprovider_AuthConfig_To_v1alpha1_AuthConfig is an autogenerated conversion function. func Convert_credentialprovider_AuthConfig_To_v1alpha1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { return autoConvert_credentialprovider_AuthConfig_To_v1alpha1_AuthConfig(in, out, s) } func autoConvert_v1alpha1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_v1alpha1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest is an autogenerated conversion function. func Convert_v1alpha1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { return autoConvert_v1alpha1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in, out, s) } func autoConvert_credentialprovider_CredentialProviderRequest_To_v1alpha1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_credentialprovider_CredentialProviderRequest_To_v1alpha1_CredentialProviderRequest is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderRequest_To_v1alpha1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderRequest_To_v1alpha1_CredentialProviderRequest(in, out, s) } func autoConvert_v1alpha1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = credentialprovider.PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*v1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]credentialprovider.AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_v1alpha1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse is an autogenerated conversion function. func Convert_v1alpha1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { return autoConvert_v1alpha1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in, out, s) } func autoConvert_credentialprovider_CredentialProviderResponse_To_v1alpha1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*v1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_credentialprovider_CredentialProviderResponse_To_v1alpha1_CredentialProviderResponse is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderResponse_To_v1alpha1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderResponse_To_v1alpha1_CredentialProviderResponse(in, out, s) } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/zz_generated.deepcopy.go000066400000000000000000000060451503561374700312620ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1alpha1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig. func (in *AuthConfig) DeepCopy() *AuthConfig { if in == nil { return nil } out := new(AuthConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderRequest) DeepCopyInto(out *CredentialProviderRequest) { *out = *in out.TypeMeta = in.TypeMeta return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderRequest. func (in *CredentialProviderRequest) DeepCopy() *CredentialProviderRequest { if in == nil { return nil } out := new(CredentialProviderRequest) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderResponse) DeepCopyInto(out *CredentialProviderResponse) { *out = *in out.TypeMeta = in.TypeMeta if in.CacheDuration != nil { in, out := &in.CacheDuration, &out.CacheDuration *out = new(v1.Duration) **out = **in } if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = make(map[string]AuthConfig, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderResponse. func (in *CredentialProviderResponse) DeepCopy() *CredentialProviderResponse { if in == nil { return nil } out := new(CredentialProviderResponse) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderResponse) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1alpha1/zz_generated.defaults.go000066400000000000000000000017651503561374700312650ustar00rootroot00000000000000//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 defaulter-gen. DO NOT EDIT. package v1alpha1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/000077500000000000000000000000001503561374700242645ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/doc.go000066400000000000000000000014711503561374700253630ustar00rootroot00000000000000/* Copyright 2022 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. */ // +k8s:deepcopy-gen=package // +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/credentialprovider // +k8s:defaulter-gen=TypeMeta // +groupName=credentialprovider.kubelet.k8s.io package v1beta1 // import "k8s.io/kubelet/pkg/apis/credentialprovider/v1beta1" kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/register.go000066400000000000000000000025241503561374700264420ustar00rootroot00000000000000/* Copyright 2022 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 ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name use in this package const GroupName = "credentialprovider.kubelet.k8s.io" // SchemeGroupVersion is group version used to register these objects var ( SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} localSchemeBuilder = &SchemeBuilder ) var ( SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &CredentialProviderRequest{}, &CredentialProviderResponse{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/types.go000066400000000000000000000130131503561374700257550ustar00rootroot00000000000000/* Copyright 2022 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 ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderRequest includes the image that the kubelet requires authentication for. // Kubelet will pass this request object to the plugin via stdin. In general, plugins should // prefer responding with the same apiVersion they were sent. type CredentialProviderRequest struct { metav1.TypeMeta `json:",inline"` // image is the container image that is being pulled as part of the // credential provider plugin request. Plugins may optionally parse the image // to extract any information required to fetch credentials. Image string `json:"image"` } type PluginCacheKeyType string const ( // ImagePluginCacheKeyType means the kubelet will cache credentials on a per-image basis, // using the image passed from the kubelet directly as the cache key. This includes // the registry domain, port (if specified), and path but does not include tags or SHAs. ImagePluginCacheKeyType PluginCacheKeyType = "Image" // RegistryPluginCacheKeyType means the kubelet will cache credentials on a per-registry basis. // The cache key will be based on the registry domain and port (if present) parsed from the requested image. RegistryPluginCacheKeyType PluginCacheKeyType = "Registry" // GlobalPluginCacheKeyType means the kubelet will cache credentials for all images that // match for a given plugin. This cache key should only be returned by plugins that do not use // the image input at all. GlobalPluginCacheKeyType PluginCacheKeyType = "Global" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // CredentialProviderResponse holds credentials that the kubelet should use for the specified // image provided in the original request. Kubelet will read the response from the plugin via stdout. // This response should be set to the same apiVersion as CredentialProviderRequest. type CredentialProviderResponse struct { metav1.TypeMeta `json:",inline"` // cacheKeyType indiciates the type of caching key to use based on the image provided // in the request. There are three valid values for the cache key type: Image, Registry, and // Global. If an invalid value is specified, the response will NOT be used by the kubelet. CacheKeyType PluginCacheKeyType `json:"cacheKeyType"` // cacheDuration indicates the duration the provided credentials should be cached for. // The kubelet will use this field to set the in-memory cache duration for credentials // in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in // CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig. // +optional CacheDuration *metav1.Duration `json:"cacheDuration,omitempty"` // auth is a map containing authentication information passed into the kubelet. // Each key is a match image string (more on this below). The corresponding authConfig value // should be valid for all images that match against this key. A plugin should set // this field to null if no valid credentials can be returned for the requested image. // // Each key in the map is a pattern which can optionally contain a port and a path. // Globs can be used in the domain, but not in the port or the path. Globs are supported // as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'. // Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match // a single subdomain segment, so *.io does not match *.k8s.io. // // The kubelet will match images against the key when all of the below are true: // - Both contain the same number of domain parts and each part matches. // - The URL path of an imageMatch must be a prefix of the target image URL path. // - If the imageMatch contains a port, then the port must match in the image as well. // // When multiple keys are returned, the kubelet will traverse all keys in reverse order so that: // - longer keys come before shorter keys with the same prefix // - non-wildcard keys come before wildcard keys with the same prefix. // // For any given match, the kubelet will attempt an image pull with the provided credentials, // stopping after the first successfully authenticated pull. // // Example keys: // - 123456789.dkr.ecr.us-east-1.amazonaws.com // - *.azurecr.io // - gcr.io // - *.*.registry.io // - registry.io:8080/path // +optional Auth map[string]AuthConfig `json:"auth,omitempty"` } // AuthConfig contains authentication information for a container registry. // Only username/password based authentication is supported today, but more authentication // mechanisms may be added in the future. type AuthConfig struct { // username is the username used for authenticating to the container registry // An empty username is valid. Username string `json:"username"` // password is the password used for authenticating to the container registry // An empty password is valid. Password string `json:"password"` } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/zz_generated.conversion.go000066400000000000000000000171341503561374700314660ustar00rootroot00000000000000//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" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" credentialprovider "k8s.io/kubelet/pkg/apis/credentialprovider" ) 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((*AuthConfig)(nil), (*credentialprovider.AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_AuthConfig_To_credentialprovider_AuthConfig(a.(*AuthConfig), b.(*credentialprovider.AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.AuthConfig)(nil), (*AuthConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_AuthConfig_To_v1beta1_AuthConfig(a.(*credentialprovider.AuthConfig), b.(*AuthConfig), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderRequest)(nil), (*credentialprovider.CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(a.(*CredentialProviderRequest), b.(*credentialprovider.CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderRequest)(nil), (*CredentialProviderRequest)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderRequest_To_v1beta1_CredentialProviderRequest(a.(*credentialprovider.CredentialProviderRequest), b.(*CredentialProviderRequest), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*CredentialProviderResponse)(nil), (*credentialprovider.CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(a.(*CredentialProviderResponse), b.(*credentialprovider.CredentialProviderResponse), scope) }); err != nil { return err } if err := s.AddGeneratedConversionFunc((*credentialprovider.CredentialProviderResponse)(nil), (*CredentialProviderResponse)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_credentialprovider_CredentialProviderResponse_To_v1beta1_CredentialProviderResponse(a.(*credentialprovider.CredentialProviderResponse), b.(*CredentialProviderResponse), scope) }); err != nil { return err } return nil } func autoConvert_v1beta1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_v1beta1_AuthConfig_To_credentialprovider_AuthConfig is an autogenerated conversion function. func Convert_v1beta1_AuthConfig_To_credentialprovider_AuthConfig(in *AuthConfig, out *credentialprovider.AuthConfig, s conversion.Scope) error { return autoConvert_v1beta1_AuthConfig_To_credentialprovider_AuthConfig(in, out, s) } func autoConvert_credentialprovider_AuthConfig_To_v1beta1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { out.Username = in.Username out.Password = in.Password return nil } // Convert_credentialprovider_AuthConfig_To_v1beta1_AuthConfig is an autogenerated conversion function. func Convert_credentialprovider_AuthConfig_To_v1beta1_AuthConfig(in *credentialprovider.AuthConfig, out *AuthConfig, s conversion.Scope) error { return autoConvert_credentialprovider_AuthConfig_To_v1beta1_AuthConfig(in, out, s) } func autoConvert_v1beta1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_v1beta1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest is an autogenerated conversion function. func Convert_v1beta1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in *CredentialProviderRequest, out *credentialprovider.CredentialProviderRequest, s conversion.Scope) error { return autoConvert_v1beta1_CredentialProviderRequest_To_credentialprovider_CredentialProviderRequest(in, out, s) } func autoConvert_credentialprovider_CredentialProviderRequest_To_v1beta1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { out.Image = in.Image return nil } // Convert_credentialprovider_CredentialProviderRequest_To_v1beta1_CredentialProviderRequest is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderRequest_To_v1beta1_CredentialProviderRequest(in *credentialprovider.CredentialProviderRequest, out *CredentialProviderRequest, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderRequest_To_v1beta1_CredentialProviderRequest(in, out, s) } func autoConvert_v1beta1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = credentialprovider.PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*v1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]credentialprovider.AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_v1beta1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse is an autogenerated conversion function. func Convert_v1beta1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in *CredentialProviderResponse, out *credentialprovider.CredentialProviderResponse, s conversion.Scope) error { return autoConvert_v1beta1_CredentialProviderResponse_To_credentialprovider_CredentialProviderResponse(in, out, s) } func autoConvert_credentialprovider_CredentialProviderResponse_To_v1beta1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { out.CacheKeyType = PluginCacheKeyType(in.CacheKeyType) out.CacheDuration = (*v1.Duration)(unsafe.Pointer(in.CacheDuration)) out.Auth = *(*map[string]AuthConfig)(unsafe.Pointer(&in.Auth)) return nil } // Convert_credentialprovider_CredentialProviderResponse_To_v1beta1_CredentialProviderResponse is an autogenerated conversion function. func Convert_credentialprovider_CredentialProviderResponse_To_v1beta1_CredentialProviderResponse(in *credentialprovider.CredentialProviderResponse, out *CredentialProviderResponse, s conversion.Scope) error { return autoConvert_credentialprovider_CredentialProviderResponse_To_v1beta1_CredentialProviderResponse(in, out, s) } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/zz_generated.deepcopy.go000066400000000000000000000060441503561374700311070ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package v1beta1 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig. func (in *AuthConfig) DeepCopy() *AuthConfig { if in == nil { return nil } out := new(AuthConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderRequest) DeepCopyInto(out *CredentialProviderRequest) { *out = *in out.TypeMeta = in.TypeMeta return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderRequest. func (in *CredentialProviderRequest) DeepCopy() *CredentialProviderRequest { if in == nil { return nil } out := new(CredentialProviderRequest) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderResponse) DeepCopyInto(out *CredentialProviderResponse) { *out = *in out.TypeMeta = in.TypeMeta if in.CacheDuration != nil { in, out := &in.CacheDuration, &out.CacheDuration *out = new(v1.Duration) **out = **in } if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = make(map[string]AuthConfig, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderResponse. func (in *CredentialProviderResponse) DeepCopy() *CredentialProviderResponse { if in == nil { return nil } out := new(CredentialProviderResponse) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderResponse) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/v1beta1/zz_generated.defaults.go000066400000000000000000000017641503561374700311120ustar00rootroot00000000000000//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 defaulter-gen. DO NOT EDIT. package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" ) // RegisterDefaults adds defaulters functions to the given scheme. // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { return nil } kubelet-kubernetes-1.32.7/pkg/apis/credentialprovider/zz_generated.deepcopy.go000066400000000000000000000060571503561374700276500ustar00rootroot00000000000000//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 deepcopy-gen. DO NOT EDIT. package credentialprovider import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AuthConfig) DeepCopyInto(out *AuthConfig) { *out = *in return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthConfig. func (in *AuthConfig) DeepCopy() *AuthConfig { if in == nil { return nil } out := new(AuthConfig) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderRequest) DeepCopyInto(out *CredentialProviderRequest) { *out = *in out.TypeMeta = in.TypeMeta return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderRequest. func (in *CredentialProviderRequest) DeepCopy() *CredentialProviderRequest { if in == nil { return nil } out := new(CredentialProviderRequest) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderRequest) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProviderResponse) DeepCopyInto(out *CredentialProviderResponse) { *out = *in out.TypeMeta = in.TypeMeta if in.CacheDuration != nil { in, out := &in.CacheDuration, &out.CacheDuration *out = new(v1.Duration) **out = **in } if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = make(map[string]AuthConfig, len(*in)) for key, val := range *in { (*out)[key] = val } } return } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CredentialProviderResponse. func (in *CredentialProviderResponse) DeepCopy() *CredentialProviderResponse { if in == nil { return nil } out := new(CredentialProviderResponse) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. func (in *CredentialProviderResponse) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } return nil } kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/000077500000000000000000000000001503561374700216125ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/OWNERS000066400000000000000000000001011503561374700225420ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners reviewers: [] kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1alpha/000077500000000000000000000000001503561374700231465ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1alpha/api.pb.go000066400000000000000000002064011503561374700246510ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1alpha import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RegisterRequest struct { // Version of the API the Device Plugin was built against Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Name of the unix socket the device plugin is listening on // PATH = path.Join(DevicePluginPath, endpoint) Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Schedulable resource name. As of now it's expected to be a DNS Label ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegisterRequest) Reset() { *m = RegisterRequest{} } func (*RegisterRequest) ProtoMessage() {} func (*RegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *RegisterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegisterRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegisterRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RegisterRequest.Merge(m, src) } func (m *RegisterRequest) XXX_Size() int { return m.Size() } func (m *RegisterRequest) XXX_DiscardUnknown() { xxx_messageInfo_RegisterRequest.DiscardUnknown(m) } var xxx_messageInfo_RegisterRequest proto.InternalMessageInfo func (m *RegisterRequest) GetVersion() string { if m != nil { return m.Version } return "" } func (m *RegisterRequest) GetEndpoint() string { if m != nil { return m.Endpoint } return "" } func (m *RegisterRequest) GetResourceName() string { if m != nil { return m.ResourceName } return "" } type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Empty) Reset() { *m = Empty{} } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *Empty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Empty.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Empty) XXX_Merge(src proto.Message) { xxx_messageInfo_Empty.Merge(m, src) } func (m *Empty) XXX_Size() int { return m.Size() } func (m *Empty) XXX_DiscardUnknown() { xxx_messageInfo_Empty.DiscardUnknown(m) } var xxx_messageInfo_Empty proto.InternalMessageInfo // ListAndWatch returns a stream of List of Devices // Whenever a Device state changes or a Device disappears, ListAndWatch // returns the new list type ListAndWatchResponse struct { Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListAndWatchResponse) Reset() { *m = ListAndWatchResponse{} } func (*ListAndWatchResponse) ProtoMessage() {} func (*ListAndWatchResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *ListAndWatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListAndWatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListAndWatchResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListAndWatchResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListAndWatchResponse.Merge(m, src) } func (m *ListAndWatchResponse) XXX_Size() int { return m.Size() } func (m *ListAndWatchResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListAndWatchResponse.DiscardUnknown(m) } var xxx_messageInfo_ListAndWatchResponse proto.InternalMessageInfo func (m *ListAndWatchResponse) GetDevices() []*Device { if m != nil { return m.Devices } return nil } // E.g: // // struct Device { // ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", // Health: "Healthy", // } type Device struct { // A unique ID assigned by the device plugin used // to identify devices during the communication // Max length of this field is 63 characters ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // Health of the device, can be healthy or unhealthy, see constants.go Health string `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Device.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Device) XXX_Merge(src proto.Message) { xxx_messageInfo_Device.Merge(m, src) } func (m *Device) XXX_Size() int { return m.Size() } func (m *Device) XXX_DiscardUnknown() { xxx_messageInfo_Device.DiscardUnknown(m) } var xxx_messageInfo_Device proto.InternalMessageInfo func (m *Device) GetID() string { if m != nil { return m.ID } return "" } func (m *Device) GetHealth() string { if m != nil { return m.Health } return "" } // - Allocate is expected to be called during pod creation since allocation // failures for any container would result in pod startup failure. // - Allocate allows kubelet to exposes additional artifacts in a pod's // environment as directed by the plugin. // - Allocate allows Device Plugin to run device specific operations on // the Devices requested type AllocateRequest struct { DevicesIDs []string `protobuf:"bytes,1,rep,name=devicesIDs,proto3" json:"devicesIDs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AllocateRequest) Reset() { *m = AllocateRequest{} } func (*AllocateRequest) ProtoMessage() {} func (*AllocateRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *AllocateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocateRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocateRequest.Merge(m, src) } func (m *AllocateRequest) XXX_Size() int { return m.Size() } func (m *AllocateRequest) XXX_DiscardUnknown() { xxx_messageInfo_AllocateRequest.DiscardUnknown(m) } var xxx_messageInfo_AllocateRequest proto.InternalMessageInfo func (m *AllocateRequest) GetDevicesIDs() []string { if m != nil { return m.DevicesIDs } return nil } // AllocateResponse includes the artifacts that needs to be injected into // a container for accessing 'deviceIDs' that were mentioned as part of // 'AllocateRequest'. // Failure Handling: // if Kubelet sends an allocation request for dev1 and dev2. // Allocation on dev1 succeeds but allocation on dev2 fails. // The Device plugin should send a ListAndWatch update and fail the // Allocation request type AllocateResponse struct { // List of environment variable to be set in the container to access one of more devices. Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"` // Devices for the container. Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"` // Container annotations to pass to the container runtime Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,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:"-"` } func (m *AllocateResponse) Reset() { *m = AllocateResponse{} } func (*AllocateResponse) ProtoMessage() {} func (*AllocateResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *AllocateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocateResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocateResponse.Merge(m, src) } func (m *AllocateResponse) XXX_Size() int { return m.Size() } func (m *AllocateResponse) XXX_DiscardUnknown() { xxx_messageInfo_AllocateResponse.DiscardUnknown(m) } var xxx_messageInfo_AllocateResponse proto.InternalMessageInfo func (m *AllocateResponse) GetEnvs() map[string]string { if m != nil { return m.Envs } return nil } func (m *AllocateResponse) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *AllocateResponse) GetDevices() []*DeviceSpec { if m != nil { return m.Devices } return nil } func (m *AllocateResponse) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } // Mount specifies a host volume to mount into a container. // where device library or tools are installed on host and container type Mount struct { // Path of the mount within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the mount on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // If set, the mount is read-only. ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Mount) Reset() { *m = Mount{} } func (*Mount) ProtoMessage() {} func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *Mount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Mount.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Mount) XXX_Merge(src proto.Message) { xxx_messageInfo_Mount.Merge(m, src) } func (m *Mount) XXX_Size() int { return m.Size() } func (m *Mount) XXX_DiscardUnknown() { xxx_messageInfo_Mount.DiscardUnknown(m) } var xxx_messageInfo_Mount proto.InternalMessageInfo func (m *Mount) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Mount) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Mount) GetReadOnly() bool { if m != nil { return m.ReadOnly } return false } // DeviceSpec specifies a host device to mount into a container. type DeviceSpec struct { // Path of the device within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the device on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DeviceSpec) Reset() { *m = DeviceSpec{} } func (*DeviceSpec) ProtoMessage() {} func (*DeviceSpec) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *DeviceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeviceSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DeviceSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_DeviceSpec.Merge(m, src) } func (m *DeviceSpec) XXX_Size() int { return m.Size() } func (m *DeviceSpec) XXX_DiscardUnknown() { xxx_messageInfo_DeviceSpec.DiscardUnknown(m) } var xxx_messageInfo_DeviceSpec proto.InternalMessageInfo func (m *DeviceSpec) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *DeviceSpec) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *DeviceSpec) GetPermissions() string { if m != nil { return m.Permissions } return "" } func init() { proto.RegisterType((*RegisterRequest)(nil), "deviceplugin.RegisterRequest") proto.RegisterType((*Empty)(nil), "deviceplugin.Empty") proto.RegisterType((*ListAndWatchResponse)(nil), "deviceplugin.ListAndWatchResponse") proto.RegisterType((*Device)(nil), "deviceplugin.Device") proto.RegisterType((*AllocateRequest)(nil), "deviceplugin.AllocateRequest") proto.RegisterType((*AllocateResponse)(nil), "deviceplugin.AllocateResponse") proto.RegisterMapType((map[string]string)(nil), "deviceplugin.AllocateResponse.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "deviceplugin.AllocateResponse.EnvsEntry") proto.RegisterType((*Mount)(nil), "deviceplugin.Mount") proto.RegisterType((*DeviceSpec)(nil), "deviceplugin.DeviceSpec") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 628 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, 0x14, 0x8d, 0x93, 0x36, 0x4d, 0x6e, 0xd3, 0x1f, 0xcd, 0x57, 0x7d, 0xb2, 0x8c, 0xb0, 0x2a, 0x23, 0xa4, 0x4a, 0x80, 0xdd, 0x86, 0x05, 0x15, 0x42, 0x88, 0xa2, 0x14, 0xa9, 0x94, 0x9f, 0x62, 0x16, 0x48, 0x6c, 0xaa, 0x89, 0x73, 0x89, 0x47, 0x71, 0x66, 0x8c, 0x67, 0x1c, 0x29, 0x3b, 0x1e, 0x81, 0xc7, 0xe0, 0x51, 0xba, 0x64, 0xc9, 0x92, 0x86, 0xe7, 0x40, 0x42, 0x19, 0xdb, 0xf9, 0xb1, 0x22, 0x10, 0x12, 0x3b, 0xdf, 0x33, 0xf7, 0x8c, 0xcf, 0x3d, 0xbe, 0xc7, 0xd0, 0xa4, 0x31, 0x73, 0xe3, 0x44, 0x28, 0x41, 0x5a, 0x3d, 0x1c, 0xb1, 0x00, 0xe3, 0x28, 0xed, 0x33, 0x6e, 0xdd, 0xeb, 0x33, 0x15, 0xa6, 0x5d, 0x37, 0x10, 0x43, 0xaf, 0x2f, 0xfa, 0xc2, 0xd3, 0x4d, 0xdd, 0xf4, 0x83, 0xae, 0x74, 0xa1, 0x9f, 0x32, 0xb2, 0x13, 0xc1, 0x8e, 0x8f, 0x7d, 0x26, 0x15, 0x26, 0x3e, 0x7e, 0x4c, 0x51, 0x2a, 0x62, 0xc2, 0xc6, 0x08, 0x13, 0xc9, 0x04, 0x37, 0x8d, 0x7d, 0xe3, 0xa0, 0xe9, 0x17, 0x25, 0xb1, 0xa0, 0x81, 0xbc, 0x17, 0x0b, 0xc6, 0x95, 0x59, 0xd5, 0x47, 0xb3, 0x9a, 0xdc, 0x82, 0xad, 0x04, 0xa5, 0x48, 0x93, 0x00, 0x2f, 0x39, 0x1d, 0xa2, 0x59, 0xd3, 0x0d, 0xad, 0x02, 0x7c, 0x45, 0x87, 0xe8, 0x6c, 0xc0, 0xfa, 0xe9, 0x30, 0x56, 0x63, 0xe7, 0x19, 0xec, 0xbd, 0x60, 0x52, 0x9d, 0xf0, 0xde, 0x3b, 0xaa, 0x82, 0xd0, 0x47, 0x19, 0x0b, 0x2e, 0x91, 0xb8, 0xb0, 0x91, 0x4d, 0x23, 0x4d, 0x63, 0xbf, 0x76, 0xb0, 0xd9, 0xde, 0x73, 0x17, 0xa7, 0x73, 0x3b, 0xba, 0xf0, 0x8b, 0x26, 0xe7, 0x10, 0xea, 0x19, 0x44, 0xb6, 0xa1, 0x7a, 0xd6, 0xc9, 0x05, 0x57, 0xcf, 0x3a, 0xe4, 0x7f, 0xa8, 0x87, 0x48, 0x23, 0x15, 0xe6, 0x4a, 0xf3, 0xca, 0x39, 0x82, 0x9d, 0x93, 0x28, 0x12, 0x01, 0x55, 0x58, 0x0c, 0x6c, 0x03, 0xe4, 0xf7, 0x9d, 0x75, 0xb2, 0xf7, 0x36, 0xfd, 0x05, 0xc4, 0xf9, 0x59, 0x85, 0xdd, 0x39, 0x27, 0x57, 0xfa, 0x08, 0xd6, 0x90, 0x8f, 0x0a, 0x99, 0x07, 0xcb, 0x32, 0xcb, 0xdd, 0xee, 0x29, 0x1f, 0xc9, 0x53, 0xae, 0x92, 0xb1, 0xaf, 0x59, 0xe4, 0x0e, 0xd4, 0x87, 0x22, 0xe5, 0x4a, 0x9a, 0x55, 0xcd, 0xff, 0x6f, 0x99, 0xff, 0x72, 0x7a, 0xe6, 0xe7, 0x2d, 0xa4, 0x3d, 0x37, 0xa5, 0xa6, 0xbb, 0xcd, 0x55, 0xa6, 0xbc, 0x8d, 0x31, 0x98, 0x19, 0x43, 0xde, 0xc0, 0x26, 0xe5, 0x5c, 0x28, 0xaa, 0x98, 0xe0, 0xd2, 0x5c, 0xd3, 0x3c, 0xef, 0x0f, 0x2a, 0x4f, 0xe6, 0x8c, 0x4c, 0xec, 0xe2, 0x1d, 0xd6, 0x03, 0x68, 0xce, 0xc6, 0x20, 0xbb, 0x50, 0x1b, 0xe0, 0x38, 0xf7, 0x7b, 0xfa, 0x48, 0xf6, 0x60, 0x7d, 0x44, 0xa3, 0x14, 0x73, 0xbf, 0xb3, 0xe2, 0x61, 0xf5, 0xd8, 0xb0, 0x1e, 0xc3, 0x6e, 0xf9, 0xe6, 0xbf, 0xe1, 0x3b, 0x21, 0xac, 0x6b, 0x43, 0xc8, 0x6d, 0xd8, 0x0e, 0x04, 0x57, 0x94, 0x71, 0x4c, 0x2e, 0x63, 0xaa, 0xc2, 0x9c, 0xbf, 0x35, 0x43, 0x2f, 0xa8, 0x0a, 0xc9, 0x0d, 0x68, 0x86, 0x42, 0xaa, 0xac, 0x23, 0xdf, 0xd3, 0x29, 0x50, 0x1c, 0x26, 0x48, 0x7b, 0x97, 0x82, 0x47, 0x63, 0xbd, 0xa3, 0x0d, 0xbf, 0x31, 0x05, 0x5e, 0xf3, 0x68, 0xec, 0x24, 0x00, 0x73, 0x33, 0xff, 0xc9, 0xeb, 0xf6, 0x61, 0x33, 0xc6, 0x64, 0xc8, 0xa4, 0xd4, 0xdf, 0x21, 0x0b, 0xc5, 0x22, 0xd4, 0xbe, 0x80, 0x56, 0x96, 0xc0, 0x44, 0xfb, 0x43, 0x9e, 0x40, 0xa3, 0x48, 0x24, 0xb9, 0xb9, 0xfc, 0xc1, 0x4a, 0x49, 0xb5, 0x4a, 0x5b, 0x93, 0x45, 0xab, 0xd2, 0xfe, 0x62, 0x40, 0x2b, 0x1b, 0xe3, 0x42, 0x1f, 0x90, 0x73, 0x68, 0x2d, 0xa6, 0x8d, 0xac, 0xe2, 0x59, 0xce, 0x32, 0xb8, 0x2a, 0x9e, 0x4e, 0xe5, 0xd0, 0x20, 0xe7, 0xd0, 0x28, 0x16, 0xa7, 0xac, 0xaf, 0x14, 0x2c, 0xcb, 0xfe, 0xfd, 0xbe, 0x39, 0x95, 0xa7, 0xcf, 0xaf, 0xae, 0x6d, 0xe3, 0xdb, 0xb5, 0x5d, 0xf9, 0x34, 0xb1, 0x8d, 0xab, 0x89, 0x6d, 0x7c, 0x9d, 0xd8, 0xc6, 0xf7, 0x89, 0x6d, 0x7c, 0xfe, 0x61, 0x57, 0xde, 0xdf, 0x1d, 0x1c, 0x4b, 0x97, 0x09, 0x6f, 0x90, 0x76, 0x31, 0x42, 0xe5, 0xc5, 0x83, 0xbe, 0x47, 0x63, 0x26, 0xbd, 0xc5, 0x6b, 0xbd, 0xd1, 0x11, 0x8d, 0xe2, 0x90, 0x76, 0xeb, 0xfa, 0x8f, 0x76, 0xff, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0x95, 0x28, 0xc9, 0x1b, 0x05, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RegistrationClient is the client API for Registration service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RegistrationClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) } type registrationClient struct { cc *grpc.ClientConn } func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient { return ®istrationClient{cc} } func (c *registrationClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, "/deviceplugin.Registration/Register", in, out, opts...) if err != nil { return nil, err } return out, nil } // RegistrationServer is the server API for Registration service. type RegistrationServer interface { Register(context.Context, *RegisterRequest) (*Empty, error) } // UnimplementedRegistrationServer can be embedded to have forward compatible implementations. type UnimplementedRegistrationServer struct { } func (*UnimplementedRegistrationServer) Register(ctx context.Context, req *RegisterRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) { 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: "/deviceplugin.Registration/Register", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RegistrationServer).Register(ctx, req.(*RegisterRequest)) } return interceptor(ctx, in, info, handler) } var _Registration_serviceDesc = grpc.ServiceDesc{ ServiceName: "deviceplugin.Registration", HandlerType: (*RegistrationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Registration_Register_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } // DevicePluginClient is the client API for DevicePlugin service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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) (DevicePlugin_ListAndWatchClient, 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.ClientConn } func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient { return &devicePluginClient{cc} } func (c *devicePluginClient) ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, error) { stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], "/deviceplugin.DevicePlugin/ListAndWatch", opts...) if err != nil { return nil, err } x := &devicePluginListAndWatchClient{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 } type DevicePlugin_ListAndWatchClient interface { Recv() (*ListAndWatchResponse, error) grpc.ClientStream } type devicePluginListAndWatchClient struct { grpc.ClientStream } func (x *devicePluginListAndWatchClient) Recv() (*ListAndWatchResponse, error) { m := new(ListAndWatchResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) { out := new(AllocateResponse) err := c.cc.Invoke(ctx, "/deviceplugin.DevicePlugin/Allocate", in, out, opts...) if err != nil { return nil, err } return out, nil } // DevicePluginServer is the server API for DevicePlugin service. 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, DevicePlugin_ListAndWatchServer) 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) } // UnimplementedDevicePluginServer can be embedded to have forward compatible implementations. type UnimplementedDevicePluginServer struct { } func (*UnimplementedDevicePluginServer) ListAndWatch(req *Empty, srv DevicePlugin_ListAndWatchServer) error { return status.Errorf(codes.Unimplemented, "method ListAndWatch not implemented") } func (*UnimplementedDevicePluginServer) Allocate(ctx context.Context, req *AllocateRequest) (*AllocateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented") } func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) { 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, &devicePluginListAndWatchServer{stream}) } type DevicePlugin_ListAndWatchServer interface { Send(*ListAndWatchResponse) error grpc.ServerStream } type devicePluginListAndWatchServer struct { grpc.ServerStream } func (x *devicePluginListAndWatchServer) Send(m *ListAndWatchResponse) error { return x.ServerStream.SendMsg(m) } 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.DevicePlugin/Allocate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DevicePluginServer).Allocate(ctx, req.(*AllocateRequest)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *RegisterRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegisterRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegisterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ResourceName) > 0 { i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName))) i-- dAtA[i] = 0x1a } if len(m.Endpoint) > 0 { i -= len(m.Endpoint) copy(dAtA[i:], m.Endpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint))) i-- dAtA[i] = 0x12 } if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Empty) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Empty) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ListAndWatchResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListAndWatchResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListAndWatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Health) > 0 { i -= len(m.Health) copy(dAtA[i:], m.Health) i = encodeVarintApi(dAtA, i, uint64(len(m.Health))) i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) i = encodeVarintApi(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *AllocateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocateRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DevicesIDs) > 0 { for iNdEx := len(m.DevicesIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DevicesIDs[iNdEx]) copy(dAtA[i:], m.DevicesIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DevicesIDs[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *AllocateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocateResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Mounts) > 0 { for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.Envs) > 0 { for k := range m.Envs { v := m.Envs[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ReadOnly { i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DeviceSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DeviceSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DeviceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Permissions) > 0 { i -= len(m.Permissions) copy(dAtA[i:], m.Permissions) i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) i-- dAtA[i] = 0x1a } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *RegisterRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Endpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.ResourceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Empty) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ListAndWatchResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ID) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Health) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *AllocateRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.DevicesIDs) > 0 { for _, s := range m.DevicesIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *AllocateResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Envs) > 0 { for k, v := range m.Envs { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *Mount) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ReadOnly { n += 2 } return n } func (m *DeviceSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Permissions) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *RegisterRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegisterRequest{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `}`, }, "") return s } func (this *Empty) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Empty{`, `}`, }, "") return s } func (this *ListAndWatchResponse) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*Device{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," } repeatedStringForDevices += "}" s := strings.Join([]string{`&ListAndWatchResponse{`, `Devices:` + repeatedStringForDevices + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Health:` + fmt.Sprintf("%v", this.Health) + `,`, `}`, }, "") return s } func (this *AllocateRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AllocateRequest{`, `DevicesIDs:` + fmt.Sprintf("%v", this.DevicesIDs) + `,`, `}`, }, "") return s } func (this *AllocateResponse) String() string { if this == nil { return "nil" } repeatedStringForMounts := "[]*Mount{" for _, f := range this.Mounts { repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," } repeatedStringForMounts += "}" repeatedStringForDevices := "[]*DeviceSpec{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "DeviceSpec", "DeviceSpec", 1) + "," } repeatedStringForDevices += "}" keysForEnvs := make([]string, 0, len(this.Envs)) for k := range this.Envs { keysForEnvs = append(keysForEnvs, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForEnvs) mapStringForEnvs := "map[string]string{" for _, k := range keysForEnvs { mapStringForEnvs += fmt.Sprintf("%v: %v,", k, this.Envs[k]) } mapStringForEnvs += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&AllocateResponse{`, `Envs:` + mapStringForEnvs + `,`, `Mounts:` + repeatedStringForMounts + `,`, `Devices:` + repeatedStringForDevices + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } func (this *Mount) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Mount{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `}`, }, "") return s } func (this *DeviceSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DeviceSpec{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *RegisterRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegisterRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegisterRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Empty) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Empty: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Empty: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListAndWatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListAndWatchResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListAndWatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Health = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AllocateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DevicesIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DevicesIDs = append(m.DevicesIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AllocateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Envs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Envs == nil { m.Envs = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Envs[mapkey] = mapvalue iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &DeviceSpec{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Mount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Mount: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ReadOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DeviceSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DeviceSpec: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DeviceSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Permissions = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1alpha/api.proto000066400000000000000000000110531503561374700250040ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` 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 // Registration may fail when device plugin version is not supported by // Kubelet or the registered resourceName is already taken by another // active device plugin. Device plugin is expected to terminate upon registration failure service Registration { rpc Register(RegisterRequest) returns (Empty) {} } message RegisterRequest { // Version of the API the Device Plugin was built against string version = 1; // Name of the unix socket the device plugin is listening on // PATH = path.Join(DevicePluginPath, endpoint) string endpoint = 2; // Schedulable resource name. As of now it's expected to be a DNS Label string resource_name = 3; } message Empty { } // DevicePlugin is the service advertised by Device Plugins service DevicePlugin { // ListAndWatch returns a stream of List of Devices // Whenever a Device state changes or a Device disappears, ListAndWatch // returns the new list rpc ListAndWatch(Empty) returns (stream ListAndWatchResponse) {} // Allocate is called during container creation so that the Device // Plugin can run device specific operations and instruct Kubelet // of the steps to make the Device available in the container rpc Allocate(AllocateRequest) returns (AllocateResponse) {} } // ListAndWatch returns a stream of List of Devices // Whenever a Device state changes or a Device disappears, ListAndWatch // returns the new list message ListAndWatchResponse { repeated Device devices = 1; } /* E.g: * struct Device { * ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", * Health: "Healthy", *} */ message Device { // A unique ID assigned by the device plugin used // to identify devices during the communication // Max length of this field is 63 characters string ID = 1; // Health of the device, can be healthy or unhealthy, see constants.go string health = 2; } // - Allocate is expected to be called during pod creation since allocation // failures for any container would result in pod startup failure. // - Allocate allows kubelet to exposes additional artifacts in a pod's // environment as directed by the plugin. // - Allocate allows Device Plugin to run device specific operations on // the Devices requested message AllocateRequest { repeated string devicesIDs = 1; } // AllocateResponse includes the artifacts that needs to be injected into // a container for accessing 'deviceIDs' that were mentioned as part of // 'AllocateRequest'. // Failure Handling: // if Kubelet sends an allocation request for dev1 and dev2. // Allocation on dev1 succeeds but allocation on dev2 fails. // The Device plugin should send a ListAndWatch update and fail the // Allocation request message AllocateResponse { // List of environment variable to be set in the container to access one of more devices. map envs = 1; // Mounts for the container. repeated Mount mounts = 2; // Devices for the container. repeated DeviceSpec devices = 3; // Container annotations to pass to the container runtime map annotations = 4; } // Mount specifies a host volume to mount into a container. // where device library or tools are installed on host and container message Mount { // Path of the mount within the container. string container_path = 1; // Path of the mount on the host. string host_path = 2; // If set, the mount is read-only. bool read_only = 3; } // DeviceSpec specifies a host device to mount into a container. message DeviceSpec { // Path of the device within the container. string container_path = 1; // Path of the device on the host. string host_path = 2; // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. string permissions = 3; } kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1alpha/constants.go000066400000000000000000000022361503561374700255140ustar00rootroot00000000000000/* Copyright 2017 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 v1alpha const ( // Healthy means that the device is healthy Healthy = "Healthy" // Unhealthy means that the device is unhealthy Unhealthy = "Unhealthy" // Version is the current version of the API supported by kubelet Version = "v1alpha2" // DevicePluginPath is the folder the Device Plugin is expecting sockets to be on // Only privileged pods have access to this path // Note: Placeholder until we find a "standard path" DevicePluginPath = "/var/lib/kubelet/device-plugins/" // KubeletSocket is the path of the Kubelet registry socket KubeletSocket = DevicePluginPath + "kubelet.sock" ) kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1beta1/000077500000000000000000000000001503561374700230555ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1beta1/api.pb.go000066400000000000000000004255031503561374700245660ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1beta1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type DevicePluginOptions struct { // Indicates if PreStartContainer call is required before each container start PreStartRequired bool `protobuf:"varint,1,opt,name=pre_start_required,json=preStartRequired,proto3" json:"pre_start_required,omitempty"` // Indicates if GetPreferredAllocation is implemented and available for calling GetPreferredAllocationAvailable bool `protobuf:"varint,2,opt,name=get_preferred_allocation_available,json=getPreferredAllocationAvailable,proto3" json:"get_preferred_allocation_available,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DevicePluginOptions) Reset() { *m = DevicePluginOptions{} } func (*DevicePluginOptions) ProtoMessage() {} func (*DevicePluginOptions) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *DevicePluginOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DevicePluginOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DevicePluginOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DevicePluginOptions) XXX_Merge(src proto.Message) { xxx_messageInfo_DevicePluginOptions.Merge(m, src) } func (m *DevicePluginOptions) XXX_Size() int { return m.Size() } func (m *DevicePluginOptions) XXX_DiscardUnknown() { xxx_messageInfo_DevicePluginOptions.DiscardUnknown(m) } var xxx_messageInfo_DevicePluginOptions proto.InternalMessageInfo func (m *DevicePluginOptions) GetPreStartRequired() bool { if m != nil { return m.PreStartRequired } return false } func (m *DevicePluginOptions) GetGetPreferredAllocationAvailable() bool { if m != nil { return m.GetPreferredAllocationAvailable } return false } type RegisterRequest struct { // Version of the API the Device Plugin was built against Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` // Name of the unix socket the device plugin is listening on // PATH = path.Join(DevicePluginPath, endpoint) Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Schedulable resource name. As of now it's expected to be a DNS Label ResourceName string `protobuf:"bytes,3,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` // Options to be communicated with Device Manager Options *DevicePluginOptions `protobuf:"bytes,4,opt,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegisterRequest) Reset() { *m = RegisterRequest{} } func (*RegisterRequest) ProtoMessage() {} func (*RegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *RegisterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegisterRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegisterRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegisterRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_RegisterRequest.Merge(m, src) } func (m *RegisterRequest) XXX_Size() int { return m.Size() } func (m *RegisterRequest) XXX_DiscardUnknown() { xxx_messageInfo_RegisterRequest.DiscardUnknown(m) } var xxx_messageInfo_RegisterRequest proto.InternalMessageInfo func (m *RegisterRequest) GetVersion() string { if m != nil { return m.Version } return "" } func (m *RegisterRequest) GetEndpoint() string { if m != nil { return m.Endpoint } return "" } func (m *RegisterRequest) GetResourceName() string { if m != nil { return m.ResourceName } return "" } func (m *RegisterRequest) GetOptions() *DevicePluginOptions { if m != nil { return m.Options } return nil } type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Empty) Reset() { *m = Empty{} } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *Empty) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Empty.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Empty) XXX_Merge(src proto.Message) { xxx_messageInfo_Empty.Merge(m, src) } func (m *Empty) XXX_Size() int { return m.Size() } func (m *Empty) XXX_DiscardUnknown() { xxx_messageInfo_Empty.DiscardUnknown(m) } var xxx_messageInfo_Empty proto.InternalMessageInfo // ListAndWatch returns a stream of List of Devices // Whenever a Device state change or a Device disappears, ListAndWatch // returns the new list type ListAndWatchResponse struct { Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListAndWatchResponse) Reset() { *m = ListAndWatchResponse{} } func (*ListAndWatchResponse) ProtoMessage() {} func (*ListAndWatchResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *ListAndWatchResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListAndWatchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListAndWatchResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListAndWatchResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListAndWatchResponse.Merge(m, src) } func (m *ListAndWatchResponse) XXX_Size() int { return m.Size() } func (m *ListAndWatchResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListAndWatchResponse.DiscardUnknown(m) } var xxx_messageInfo_ListAndWatchResponse proto.InternalMessageInfo func (m *ListAndWatchResponse) GetDevices() []*Device { if m != nil { return m.Devices } return nil } type TopologyInfo struct { Nodes []*NUMANode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *TopologyInfo) Reset() { *m = TopologyInfo{} } func (*TopologyInfo) ProtoMessage() {} func (*TopologyInfo) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *TopologyInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *TopologyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TopologyInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *TopologyInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_TopologyInfo.Merge(m, src) } func (m *TopologyInfo) XXX_Size() int { return m.Size() } func (m *TopologyInfo) XXX_DiscardUnknown() { xxx_messageInfo_TopologyInfo.DiscardUnknown(m) } var xxx_messageInfo_TopologyInfo proto.InternalMessageInfo func (m *TopologyInfo) GetNodes() []*NUMANode { if m != nil { return m.Nodes } return nil } type NUMANode struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NUMANode) Reset() { *m = NUMANode{} } func (*NUMANode) ProtoMessage() {} func (*NUMANode) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NUMANode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NUMANode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NUMANode.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NUMANode) XXX_Merge(src proto.Message) { xxx_messageInfo_NUMANode.Merge(m, src) } func (m *NUMANode) XXX_Size() int { return m.Size() } func (m *NUMANode) XXX_DiscardUnknown() { xxx_messageInfo_NUMANode.DiscardUnknown(m) } var xxx_messageInfo_NUMANode proto.InternalMessageInfo func (m *NUMANode) GetID() int64 { if m != nil { return m.ID } return 0 } // E.g: // // struct Device { // ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", // Health: "Healthy", // Topology: // Node: // ID: 1 // } type Device struct { // A unique ID assigned by the device plugin used // to identify devices during the communication // Max length of this field is 63 characters ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` // Health of the device, can be healthy or unhealthy, see constants.go Health string `protobuf:"bytes,2,opt,name=health,proto3" json:"health,omitempty"` // Topology for device Topology *TopologyInfo `protobuf:"bytes,3,opt,name=topology,proto3" json:"topology,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Device.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Device) XXX_Merge(src proto.Message) { xxx_messageInfo_Device.Merge(m, src) } func (m *Device) XXX_Size() int { return m.Size() } func (m *Device) XXX_DiscardUnknown() { xxx_messageInfo_Device.DiscardUnknown(m) } var xxx_messageInfo_Device proto.InternalMessageInfo func (m *Device) GetID() string { if m != nil { return m.ID } return "" } func (m *Device) GetHealth() string { if m != nil { return m.Health } return "" } func (m *Device) GetTopology() *TopologyInfo { if m != nil { return m.Topology } return nil } // - PreStartContainer is expected to be called before each container start if indicated by plugin during registration phase. // - PreStartContainer allows kubelet to pass reinitialized devices to containers. // - PreStartContainer allows Device Plugin to run device specific operations on // the Devices requested type PreStartContainerRequest struct { DevicesIDs []string `protobuf:"bytes,1,rep,name=devices_ids,json=devicesIds,proto3" json:"devices_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreStartContainerRequest) Reset() { *m = PreStartContainerRequest{} } func (*PreStartContainerRequest) ProtoMessage() {} func (*PreStartContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *PreStartContainerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreStartContainerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreStartContainerRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PreStartContainerRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_PreStartContainerRequest.Merge(m, src) } func (m *PreStartContainerRequest) XXX_Size() int { return m.Size() } func (m *PreStartContainerRequest) XXX_DiscardUnknown() { xxx_messageInfo_PreStartContainerRequest.DiscardUnknown(m) } var xxx_messageInfo_PreStartContainerRequest proto.InternalMessageInfo func (m *PreStartContainerRequest) GetDevicesIDs() []string { if m != nil { return m.DevicesIDs } return nil } // PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest type PreStartContainerResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreStartContainerResponse) Reset() { *m = PreStartContainerResponse{} } func (*PreStartContainerResponse) ProtoMessage() {} func (*PreStartContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{8} } func (m *PreStartContainerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreStartContainerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreStartContainerResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PreStartContainerResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_PreStartContainerResponse.Merge(m, src) } func (m *PreStartContainerResponse) XXX_Size() int { return m.Size() } func (m *PreStartContainerResponse) XXX_DiscardUnknown() { xxx_messageInfo_PreStartContainerResponse.DiscardUnknown(m) } var xxx_messageInfo_PreStartContainerResponse proto.InternalMessageInfo // PreferredAllocationRequest is passed via a call to GetPreferredAllocation() // at pod admission time. The device plugin should take the list of // `available_deviceIDs` and calculate a preferred allocation of size // 'allocation_size' from them, making sure to include the set of devices // listed in 'must_include_deviceIDs'. type PreferredAllocationRequest struct { ContainerRequests []*ContainerPreferredAllocationRequest `protobuf:"bytes,1,rep,name=container_requests,json=containerRequests,proto3" json:"container_requests,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreferredAllocationRequest) Reset() { *m = PreferredAllocationRequest{} } func (*PreferredAllocationRequest) ProtoMessage() {} func (*PreferredAllocationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{9} } func (m *PreferredAllocationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreferredAllocationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreferredAllocationRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PreferredAllocationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_PreferredAllocationRequest.Merge(m, src) } func (m *PreferredAllocationRequest) XXX_Size() int { return m.Size() } func (m *PreferredAllocationRequest) XXX_DiscardUnknown() { xxx_messageInfo_PreferredAllocationRequest.DiscardUnknown(m) } var xxx_messageInfo_PreferredAllocationRequest proto.InternalMessageInfo func (m *PreferredAllocationRequest) GetContainerRequests() []*ContainerPreferredAllocationRequest { if m != nil { return m.ContainerRequests } return nil } type ContainerPreferredAllocationRequest struct { // List of available deviceIDs from which to choose a preferred allocation AvailableDeviceIDs []string `protobuf:"bytes,1,rep,name=available_deviceIDs,json=availableDeviceIDs,proto3" json:"available_deviceIDs,omitempty"` // List of deviceIDs that must be included in the preferred allocation MustIncludeDeviceIDs []string `protobuf:"bytes,2,rep,name=must_include_deviceIDs,json=mustIncludeDeviceIDs,proto3" json:"must_include_deviceIDs,omitempty"` // Number of devices to include in the preferred allocation AllocationSize int32 `protobuf:"varint,3,opt,name=allocation_size,json=allocationSize,proto3" json:"allocation_size,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerPreferredAllocationRequest) Reset() { *m = ContainerPreferredAllocationRequest{} } func (*ContainerPreferredAllocationRequest) ProtoMessage() {} func (*ContainerPreferredAllocationRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{10} } func (m *ContainerPreferredAllocationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerPreferredAllocationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerPreferredAllocationRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerPreferredAllocationRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerPreferredAllocationRequest.Merge(m, src) } func (m *ContainerPreferredAllocationRequest) XXX_Size() int { return m.Size() } func (m *ContainerPreferredAllocationRequest) XXX_DiscardUnknown() { xxx_messageInfo_ContainerPreferredAllocationRequest.DiscardUnknown(m) } var xxx_messageInfo_ContainerPreferredAllocationRequest proto.InternalMessageInfo func (m *ContainerPreferredAllocationRequest) GetAvailableDeviceIDs() []string { if m != nil { return m.AvailableDeviceIDs } return nil } func (m *ContainerPreferredAllocationRequest) GetMustIncludeDeviceIDs() []string { if m != nil { return m.MustIncludeDeviceIDs } return nil } func (m *ContainerPreferredAllocationRequest) GetAllocationSize() int32 { if m != nil { return m.AllocationSize } return 0 } // PreferredAllocationResponse returns a preferred allocation, // resulting from a PreferredAllocationRequest. type PreferredAllocationResponse struct { ContainerResponses []*ContainerPreferredAllocationResponse `protobuf:"bytes,1,rep,name=container_responses,json=containerResponses,proto3" json:"container_responses,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PreferredAllocationResponse) Reset() { *m = PreferredAllocationResponse{} } func (*PreferredAllocationResponse) ProtoMessage() {} func (*PreferredAllocationResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{11} } func (m *PreferredAllocationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PreferredAllocationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PreferredAllocationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PreferredAllocationResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_PreferredAllocationResponse.Merge(m, src) } func (m *PreferredAllocationResponse) XXX_Size() int { return m.Size() } func (m *PreferredAllocationResponse) XXX_DiscardUnknown() { xxx_messageInfo_PreferredAllocationResponse.DiscardUnknown(m) } var xxx_messageInfo_PreferredAllocationResponse proto.InternalMessageInfo func (m *PreferredAllocationResponse) GetContainerResponses() []*ContainerPreferredAllocationResponse { if m != nil { return m.ContainerResponses } return nil } type ContainerPreferredAllocationResponse struct { DeviceIDs []string `protobuf:"bytes,1,rep,name=deviceIDs,proto3" json:"deviceIDs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerPreferredAllocationResponse) Reset() { *m = ContainerPreferredAllocationResponse{} } func (*ContainerPreferredAllocationResponse) ProtoMessage() {} func (*ContainerPreferredAllocationResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{12} } func (m *ContainerPreferredAllocationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerPreferredAllocationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerPreferredAllocationResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerPreferredAllocationResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerPreferredAllocationResponse.Merge(m, src) } func (m *ContainerPreferredAllocationResponse) XXX_Size() int { return m.Size() } func (m *ContainerPreferredAllocationResponse) XXX_DiscardUnknown() { xxx_messageInfo_ContainerPreferredAllocationResponse.DiscardUnknown(m) } var xxx_messageInfo_ContainerPreferredAllocationResponse proto.InternalMessageInfo func (m *ContainerPreferredAllocationResponse) GetDeviceIDs() []string { if m != nil { return m.DeviceIDs } return nil } // - Allocate is expected to be called during pod creation since allocation // failures for any container would result in pod startup failure. // - Allocate allows kubelet to exposes additional artifacts in a pod's // environment as directed by the plugin. // - Allocate allows Device Plugin to run device specific operations on // the Devices requested type AllocateRequest struct { ContainerRequests []*ContainerAllocateRequest `protobuf:"bytes,1,rep,name=container_requests,json=containerRequests,proto3" json:"container_requests,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AllocateRequest) Reset() { *m = AllocateRequest{} } func (*AllocateRequest) ProtoMessage() {} func (*AllocateRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{13} } func (m *AllocateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocateRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocateRequest.Merge(m, src) } func (m *AllocateRequest) XXX_Size() int { return m.Size() } func (m *AllocateRequest) XXX_DiscardUnknown() { xxx_messageInfo_AllocateRequest.DiscardUnknown(m) } var xxx_messageInfo_AllocateRequest proto.InternalMessageInfo func (m *AllocateRequest) GetContainerRequests() []*ContainerAllocateRequest { if m != nil { return m.ContainerRequests } return nil } type ContainerAllocateRequest struct { DevicesIDs []string `protobuf:"bytes,1,rep,name=devices_ids,json=devicesIds,proto3" json:"devices_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerAllocateRequest) Reset() { *m = ContainerAllocateRequest{} } func (*ContainerAllocateRequest) ProtoMessage() {} func (*ContainerAllocateRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{14} } func (m *ContainerAllocateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerAllocateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerAllocateRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerAllocateRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerAllocateRequest.Merge(m, src) } func (m *ContainerAllocateRequest) XXX_Size() int { return m.Size() } func (m *ContainerAllocateRequest) XXX_DiscardUnknown() { xxx_messageInfo_ContainerAllocateRequest.DiscardUnknown(m) } var xxx_messageInfo_ContainerAllocateRequest proto.InternalMessageInfo func (m *ContainerAllocateRequest) GetDevicesIDs() []string { if m != nil { return m.DevicesIDs } return nil } // CDIDevice specifies a CDI device information. type CDIDevice struct { // Fully qualified CDI device name // for example: vendor.com/gpu=gpudevice1 // see more details in the CDI specification: // https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CDIDevice) Reset() { *m = CDIDevice{} } func (*CDIDevice) ProtoMessage() {} func (*CDIDevice) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{15} } func (m *CDIDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CDIDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CDIDevice.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *CDIDevice) XXX_Merge(src proto.Message) { xxx_messageInfo_CDIDevice.Merge(m, src) } func (m *CDIDevice) XXX_Size() int { return m.Size() } func (m *CDIDevice) XXX_DiscardUnknown() { xxx_messageInfo_CDIDevice.DiscardUnknown(m) } var xxx_messageInfo_CDIDevice proto.InternalMessageInfo func (m *CDIDevice) GetName() string { if m != nil { return m.Name } return "" } // AllocateResponse includes the artifacts that needs to be injected into // a container for accessing 'deviceIDs' that were mentioned as part of // 'AllocateRequest'. // Failure Handling: // if Kubelet sends an allocation request for dev1 and dev2. // Allocation on dev1 succeeds but allocation on dev2 fails. // The Device plugin should send a ListAndWatch update and fail the // Allocation request type AllocateResponse struct { ContainerResponses []*ContainerAllocateResponse `protobuf:"bytes,1,rep,name=container_responses,json=containerResponses,proto3" json:"container_responses,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AllocateResponse) Reset() { *m = AllocateResponse{} } func (*AllocateResponse) ProtoMessage() {} func (*AllocateResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{16} } func (m *AllocateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocateResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocateResponse.Merge(m, src) } func (m *AllocateResponse) XXX_Size() int { return m.Size() } func (m *AllocateResponse) XXX_DiscardUnknown() { xxx_messageInfo_AllocateResponse.DiscardUnknown(m) } var xxx_messageInfo_AllocateResponse proto.InternalMessageInfo func (m *AllocateResponse) GetContainerResponses() []*ContainerAllocateResponse { if m != nil { return m.ContainerResponses } return nil } type ContainerAllocateResponse struct { // List of environment variable to be set in the container to access one of more devices. Envs map[string]string `protobuf:"bytes,1,rep,name=envs,proto3" json:"envs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Mounts for the container. Mounts []*Mount `protobuf:"bytes,2,rep,name=mounts,proto3" json:"mounts,omitempty"` // Devices for the container. Devices []*DeviceSpec `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"` // Container annotations to pass to the container runtime Annotations map[string]string `protobuf:"bytes,4,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // CDI devices for the container. CDIDevices []*CDIDevice `protobuf:"bytes,5,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerAllocateResponse) Reset() { *m = ContainerAllocateResponse{} } func (*ContainerAllocateResponse) ProtoMessage() {} func (*ContainerAllocateResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{17} } func (m *ContainerAllocateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerAllocateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerAllocateResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerAllocateResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerAllocateResponse.Merge(m, src) } func (m *ContainerAllocateResponse) XXX_Size() int { return m.Size() } func (m *ContainerAllocateResponse) XXX_DiscardUnknown() { xxx_messageInfo_ContainerAllocateResponse.DiscardUnknown(m) } var xxx_messageInfo_ContainerAllocateResponse proto.InternalMessageInfo func (m *ContainerAllocateResponse) GetEnvs() map[string]string { if m != nil { return m.Envs } return nil } func (m *ContainerAllocateResponse) GetMounts() []*Mount { if m != nil { return m.Mounts } return nil } func (m *ContainerAllocateResponse) GetDevices() []*DeviceSpec { if m != nil { return m.Devices } return nil } func (m *ContainerAllocateResponse) GetAnnotations() map[string]string { if m != nil { return m.Annotations } return nil } func (m *ContainerAllocateResponse) GetCDIDevices() []*CDIDevice { if m != nil { return m.CDIDevices } return nil } // Mount specifies a host volume to mount into a container. // where device library or tools are installed on host and container type Mount struct { // Path of the mount within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the mount on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // If set, the mount is read-only. ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Mount) Reset() { *m = Mount{} } func (*Mount) ProtoMessage() {} func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{18} } func (m *Mount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Mount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Mount.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Mount) XXX_Merge(src proto.Message) { xxx_messageInfo_Mount.Merge(m, src) } func (m *Mount) XXX_Size() int { return m.Size() } func (m *Mount) XXX_DiscardUnknown() { xxx_messageInfo_Mount.DiscardUnknown(m) } var xxx_messageInfo_Mount proto.InternalMessageInfo func (m *Mount) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *Mount) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *Mount) GetReadOnly() bool { if m != nil { return m.ReadOnly } return false } // DeviceSpec specifies a host device to mount into a container. type DeviceSpec struct { // Path of the device within the container. ContainerPath string `protobuf:"bytes,1,opt,name=container_path,json=containerPath,proto3" json:"container_path,omitempty"` // Path of the device on the host. HostPath string `protobuf:"bytes,2,opt,name=host_path,json=hostPath,proto3" json:"host_path,omitempty"` // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. Permissions string `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DeviceSpec) Reset() { *m = DeviceSpec{} } func (*DeviceSpec) ProtoMessage() {} func (*DeviceSpec) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{19} } func (m *DeviceSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DeviceSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeviceSpec.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DeviceSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_DeviceSpec.Merge(m, src) } func (m *DeviceSpec) XXX_Size() int { return m.Size() } func (m *DeviceSpec) XXX_DiscardUnknown() { xxx_messageInfo_DeviceSpec.DiscardUnknown(m) } var xxx_messageInfo_DeviceSpec proto.InternalMessageInfo func (m *DeviceSpec) GetContainerPath() string { if m != nil { return m.ContainerPath } return "" } func (m *DeviceSpec) GetHostPath() string { if m != nil { return m.HostPath } return "" } func (m *DeviceSpec) GetPermissions() string { if m != nil { return m.Permissions } return "" } func init() { proto.RegisterType((*DevicePluginOptions)(nil), "v1beta1.DevicePluginOptions") proto.RegisterType((*RegisterRequest)(nil), "v1beta1.RegisterRequest") proto.RegisterType((*Empty)(nil), "v1beta1.Empty") proto.RegisterType((*ListAndWatchResponse)(nil), "v1beta1.ListAndWatchResponse") proto.RegisterType((*TopologyInfo)(nil), "v1beta1.TopologyInfo") proto.RegisterType((*NUMANode)(nil), "v1beta1.NUMANode") proto.RegisterType((*Device)(nil), "v1beta1.Device") proto.RegisterType((*PreStartContainerRequest)(nil), "v1beta1.PreStartContainerRequest") proto.RegisterType((*PreStartContainerResponse)(nil), "v1beta1.PreStartContainerResponse") proto.RegisterType((*PreferredAllocationRequest)(nil), "v1beta1.PreferredAllocationRequest") proto.RegisterType((*ContainerPreferredAllocationRequest)(nil), "v1beta1.ContainerPreferredAllocationRequest") proto.RegisterType((*PreferredAllocationResponse)(nil), "v1beta1.PreferredAllocationResponse") proto.RegisterType((*ContainerPreferredAllocationResponse)(nil), "v1beta1.ContainerPreferredAllocationResponse") proto.RegisterType((*AllocateRequest)(nil), "v1beta1.AllocateRequest") proto.RegisterType((*ContainerAllocateRequest)(nil), "v1beta1.ContainerAllocateRequest") proto.RegisterType((*CDIDevice)(nil), "v1beta1.CDIDevice") proto.RegisterType((*AllocateResponse)(nil), "v1beta1.AllocateResponse") proto.RegisterType((*ContainerAllocateResponse)(nil), "v1beta1.ContainerAllocateResponse") proto.RegisterMapType((map[string]string)(nil), "v1beta1.ContainerAllocateResponse.AnnotationsEntry") proto.RegisterMapType((map[string]string)(nil), "v1beta1.ContainerAllocateResponse.EnvsEntry") proto.RegisterType((*Mount)(nil), "v1beta1.Mount") proto.RegisterType((*DeviceSpec)(nil), "v1beta1.DeviceSpec") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 1088 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xef, 0x6e, 0x1b, 0x45, 0x10, 0xcf, 0xc5, 0x71, 0x62, 0x8f, 0xd3, 0xfc, 0xd9, 0x84, 0xc8, 0x71, 0x8a, 0x93, 0x6e, 0x0a, 0x0d, 0x52, 0x62, 0x13, 0x17, 0xb5, 0x15, 0x1f, 0x10, 0x6e, 0x1c, 0xc0, 0x84, 0xa6, 0xd1, 0x85, 0x0a, 0x09, 0x10, 0xa7, 0xf3, 0xdd, 0xc6, 0x3e, 0xe5, 0xbc, 0x7b, 0xdc, 0xae, 0x2d, 0xb9, 0x12, 0x12, 0x8f, 0xd0, 0x77, 0x80, 0x57, 0xe0, 0x1d, 0xca, 0x37, 0x3e, 0xf2, 0x09, 0xd1, 0xf0, 0x22, 0xc8, 0xbb, 0xb7, 0x77, 0xa7, 0x8b, 0x63, 0xa5, 0x52, 0xbf, 0xdd, 0xce, 0xcc, 0x6f, 0x66, 0xf6, 0x37, 0xb3, 0x33, 0x07, 0x45, 0x3b, 0xf0, 0x6a, 0x41, 0xc8, 0x04, 0x43, 0x0b, 0xc3, 0xc3, 0x0e, 0x11, 0xf6, 0x61, 0xe5, 0xa0, 0xeb, 0x89, 0xde, 0xa0, 0x53, 0x73, 0x58, 0xbf, 0xde, 0x65, 0x5d, 0x56, 0x97, 0xfa, 0xce, 0xe0, 0x42, 0x9e, 0xe4, 0x41, 0x7e, 0x29, 0x1c, 0x7e, 0x65, 0xc0, 0x5a, 0x8b, 0x0c, 0x3d, 0x87, 0x9c, 0xf9, 0x83, 0xae, 0x47, 0x9f, 0x07, 0xc2, 0x63, 0x94, 0xa3, 0x7d, 0x40, 0x41, 0x48, 0x2c, 0x2e, 0xec, 0x50, 0x58, 0x21, 0xf9, 0x79, 0xe0, 0x85, 0xc4, 0x2d, 0x1b, 0x3b, 0xc6, 0x5e, 0xc1, 0x5c, 0x09, 0x42, 0x72, 0x3e, 0x56, 0x98, 0x91, 0x1c, 0x9d, 0x00, 0xee, 0x12, 0x61, 0x05, 0x21, 0xb9, 0x20, 0x61, 0x48, 0x5c, 0xcb, 0xf6, 0x7d, 0xe6, 0xd8, 0x63, 0x57, 0x96, 0x3d, 0xb4, 0x3d, 0xdf, 0xee, 0xf8, 0xa4, 0x3c, 0x2b, 0xd1, 0xdb, 0x5d, 0x22, 0xce, 0xb4, 0x61, 0x33, 0xb6, 0x6b, 0x6a, 0x33, 0xfc, 0xbb, 0x01, 0xcb, 0x26, 0xe9, 0x7a, 0x5c, 0x90, 0x70, 0x1c, 0x81, 0x70, 0x81, 0xca, 0xb0, 0x30, 0x24, 0x21, 0xf7, 0x18, 0x95, 0x39, 0x14, 0x4d, 0x7d, 0x44, 0x15, 0x28, 0x10, 0xea, 0x06, 0xcc, 0xa3, 0x42, 0x06, 0x28, 0x9a, 0xf1, 0x19, 0xed, 0xc2, 0x9d, 0x90, 0x70, 0x36, 0x08, 0x1d, 0x62, 0x51, 0xbb, 0x4f, 0xca, 0x39, 0x69, 0xb0, 0xa8, 0x85, 0xa7, 0x76, 0x9f, 0xa0, 0x47, 0xb0, 0xc0, 0xd4, 0xa5, 0xcb, 0x73, 0x3b, 0xc6, 0x5e, 0xa9, 0x71, 0xb7, 0x16, 0x71, 0x59, 0x9b, 0x40, 0x8c, 0xa9, 0x8d, 0xf1, 0x02, 0xe4, 0x8f, 0xfb, 0x81, 0x18, 0xe1, 0x26, 0xac, 0x7f, 0xe3, 0x71, 0xd1, 0xa4, 0xee, 0x77, 0xb6, 0x70, 0x7a, 0x26, 0xe1, 0x01, 0xa3, 0x9c, 0xa0, 0x8f, 0x60, 0xc1, 0x95, 0x0e, 0x78, 0xd9, 0xd8, 0xc9, 0xed, 0x95, 0x1a, 0xcb, 0x19, 0xc7, 0xa6, 0xd6, 0xe3, 0xc7, 0xb0, 0xf8, 0x2d, 0x0b, 0x98, 0xcf, 0xba, 0xa3, 0x36, 0xbd, 0x60, 0xe8, 0x01, 0xe4, 0x29, 0x73, 0x63, 0xe0, 0x6a, 0x0c, 0x3c, 0x7d, 0xf1, 0xac, 0x79, 0xca, 0x5c, 0x62, 0x2a, 0x3d, 0xae, 0x40, 0x41, 0x8b, 0xd0, 0x12, 0xcc, 0xb6, 0x5b, 0x92, 0x9e, 0x9c, 0x39, 0xdb, 0x6e, 0x61, 0x07, 0xe6, 0x55, 0x9c, 0x94, 0xa6, 0x38, 0xd6, 0xa0, 0x0d, 0x98, 0xef, 0x11, 0xdb, 0x17, 0xbd, 0x88, 0xb1, 0xe8, 0x84, 0x0e, 0xa1, 0x20, 0xa2, 0x34, 0x24, 0x55, 0xa5, 0xc6, 0x7b, 0x71, 0xe4, 0x74, 0x7e, 0x66, 0x6c, 0x86, 0x4f, 0xa0, 0x7c, 0x16, 0x75, 0xc3, 0x11, 0xa3, 0xc2, 0xf6, 0x68, 0x52, 0xb4, 0x3a, 0x94, 0xa2, 0x0b, 0x5a, 0x9e, 0xab, 0xee, 0x52, 0x7c, 0xba, 0x74, 0xf5, 0xcf, 0x36, 0xa8, 0xbc, 0x78, 0xbb, 0xc5, 0x4d, 0x88, 0x4c, 0xda, 0x2e, 0xc7, 0x5b, 0xb0, 0x39, 0xc1, 0x99, 0xa2, 0x13, 0x8f, 0xa0, 0x32, 0xa1, 0x6d, 0x74, 0xac, 0x1f, 0x00, 0x39, 0x1a, 0x22, 0xfb, 0x95, 0x70, 0xa1, 0xe9, 0xdb, 0x8f, 0x2f, 0x11, 0x7b, 0xbd, 0xd9, 0x93, 0xb9, 0xea, 0x64, 0xee, 0xc1, 0xf1, 0x1f, 0x06, 0xec, 0xde, 0x02, 0x8a, 0xea, 0xb0, 0x16, 0x77, 0xbb, 0xa5, 0xee, 0xd5, 0x6e, 0x45, 0x17, 0x37, 0x51, 0xac, 0x6a, 0x69, 0x0d, 0xfa, 0x04, 0x36, 0xfa, 0x03, 0x2e, 0x2c, 0x8f, 0x3a, 0xfe, 0xc0, 0x4d, 0x63, 0x66, 0x25, 0x66, 0x7d, 0xac, 0x6d, 0x2b, 0x65, 0x82, 0x7a, 0x00, 0xcb, 0xa9, 0xf7, 0xc5, 0xbd, 0x97, 0xaa, 0xb1, 0xf3, 0xe6, 0x52, 0x22, 0x3e, 0xf7, 0x5e, 0x12, 0xfc, 0x0b, 0x6c, 0x4d, 0xcc, 0x36, 0x6a, 0xd0, 0x9f, 0x60, 0x2d, 0xcd, 0x99, 0x92, 0x6a, 0xd2, 0x0e, 0x6e, 0x49, 0x9a, 0x42, 0x99, 0xc8, 0xc9, 0x16, 0x8c, 0xe3, 0x16, 0xdc, 0xbf, 0x0d, 0x16, 0xdd, 0x85, 0x62, 0x96, 0xac, 0x44, 0x80, 0x1d, 0x58, 0x8e, 0x30, 0x44, 0xf3, 0x7c, 0x36, 0xa5, 0xd8, 0xf7, 0xae, 0xe7, 0x9d, 0x81, 0x4f, 0xaa, 0xf0, 0x09, 0x94, 0x6f, 0x32, 0x7f, 0xfb, 0x36, 0xde, 0x86, 0xe2, 0x51, 0xab, 0x1d, 0xbd, 0x3d, 0x04, 0x73, 0x72, 0xf4, 0xa8, 0xd7, 0x27, 0xbf, 0x71, 0x17, 0x56, 0x92, 0x20, 0x11, 0x09, 0xe7, 0xd3, 0x8a, 0x81, 0xa7, 0x5d, 0x6a, 0x4a, 0x05, 0xfe, 0xcc, 0xc1, 0xe6, 0x8d, 0x08, 0xf4, 0x39, 0xcc, 0x11, 0x3a, 0x9c, 0xf2, 0x4a, 0xb2, 0x88, 0xda, 0x31, 0x1d, 0xf2, 0x63, 0x2a, 0xc2, 0x91, 0x29, 0x91, 0xe8, 0x43, 0x98, 0xef, 0xb3, 0x01, 0x15, 0xaa, 0x5f, 0x4b, 0x8d, 0xa5, 0xd8, 0xc7, 0xb3, 0xb1, 0xd8, 0x8c, 0xb4, 0xe8, 0x20, 0x19, 0x85, 0x39, 0x69, 0xb8, 0x96, 0x19, 0x85, 0xe7, 0x01, 0x71, 0xe2, 0x71, 0x88, 0x5e, 0x40, 0xc9, 0xa6, 0x94, 0x09, 0x5b, 0x8f, 0xe5, 0x31, 0xe4, 0xe1, 0x2d, 0xf2, 0x6b, 0x26, 0x28, 0x95, 0x66, 0xda, 0x0f, 0x3a, 0x82, 0x92, 0xe3, 0x7a, 0x96, 0xce, 0x24, 0x2f, 0xdd, 0xa2, 0xc4, 0xad, 0xae, 0x99, 0x2a, 0x6e, 0x7c, 0xe4, 0x26, 0x38, 0xae, 0x17, 0x7d, 0x57, 0x1e, 0x43, 0x31, 0x66, 0x01, 0xad, 0x40, 0xee, 0x92, 0x8c, 0xa2, 0xda, 0x8e, 0x3f, 0xd1, 0x3a, 0xe4, 0x87, 0xb6, 0x3f, 0x20, 0xd1, 0x64, 0x55, 0x87, 0x4f, 0x67, 0x9f, 0x18, 0x95, 0xcf, 0x60, 0x25, 0x9b, 0xde, 0xdb, 0xe0, 0x71, 0x0f, 0xf2, 0x92, 0x54, 0xf4, 0x01, 0x2c, 0x25, 0x9d, 0x12, 0xd8, 0xa2, 0x17, 0xe1, 0xef, 0xc4, 0xd2, 0x33, 0x5b, 0xf4, 0xd0, 0x16, 0x14, 0x7b, 0x8c, 0x0b, 0x65, 0x11, 0x6d, 0xc6, 0xb1, 0x40, 0x2b, 0x43, 0x62, 0xbb, 0x16, 0xa3, 0xbe, 0x1a, 0xf5, 0x05, 0xb3, 0x30, 0x16, 0x3c, 0xa7, 0xfe, 0x08, 0x87, 0x00, 0x49, 0x55, 0xde, 0x49, 0xb8, 0x1d, 0x28, 0x05, 0x24, 0xec, 0x7b, 0x9c, 0xcb, 0x82, 0xaa, 0x35, 0x9c, 0x16, 0x35, 0xbe, 0x80, 0x45, 0xb5, 0xf3, 0x43, 0xc9, 0x0f, 0x7a, 0x04, 0x05, 0xfd, 0x0f, 0x80, 0xca, 0x71, 0x89, 0x32, 0xbf, 0x05, 0x95, 0xa4, 0xdf, 0xd4, 0x2a, 0x9e, 0x69, 0xfc, 0x96, 0x83, 0xc5, 0xf4, 0xda, 0x46, 0x5f, 0xc1, 0xc6, 0x97, 0x44, 0x4c, 0xfa, 0xc5, 0xc9, 0x80, 0x2b, 0x53, 0xf7, 0x3e, 0x9e, 0x41, 0x4d, 0x58, 0x4c, 0xef, 0xf9, 0x6b, 0xf8, 0xf7, 0xe3, 0xf3, 0xa4, 0xdf, 0x01, 0x3c, 0xf3, 0xb1, 0x81, 0x88, 0x4c, 0x66, 0xc2, 0x2c, 0x44, 0xbb, 0x31, 0xf8, 0xe6, 0xfd, 0x52, 0xb9, 0x3f, 0xdd, 0x48, 0x07, 0x42, 0x4d, 0x28, 0xe8, 0xa7, 0x91, 0x22, 0x2f, 0x33, 0xd7, 0x2a, 0x9b, 0x13, 0x34, 0xb1, 0x8b, 0x1f, 0x61, 0xf5, 0xda, 0x2a, 0x46, 0xf7, 0xd2, 0xf1, 0x27, 0xee, 0xfc, 0x0a, 0x9e, 0x66, 0xa2, 0xbd, 0x3f, 0xfd, 0xfa, 0xf5, 0x9b, 0xaa, 0xf1, 0xf7, 0x9b, 0xea, 0xcc, 0xaf, 0x57, 0x55, 0xe3, 0xf5, 0x55, 0xd5, 0xf8, 0xeb, 0xaa, 0x6a, 0xfc, 0x7b, 0x55, 0x35, 0x5e, 0xfd, 0x57, 0x9d, 0xf9, 0x7e, 0xff, 0xf2, 0x09, 0xaf, 0x79, 0xac, 0x7e, 0x39, 0xe8, 0x10, 0x9f, 0x88, 0x7a, 0x70, 0xd9, 0xad, 0xdb, 0x81, 0xc7, 0xeb, 0xea, 0xe5, 0x06, 0xb2, 0x2e, 0xf5, 0x28, 0x4e, 0x67, 0x5e, 0xfe, 0xc8, 0x3e, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x26, 0x52, 0x96, 0x0d, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RegistrationClient is the client API for Registration service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type RegistrationClient interface { Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) } type registrationClient struct { cc *grpc.ClientConn } func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient { return ®istrationClient{cc} } func (c *registrationClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*Empty, error) { out := new(Empty) err := c.cc.Invoke(ctx, "/v1beta1.Registration/Register", in, out, opts...) if err != nil { return nil, err } return out, nil } // RegistrationServer is the server API for Registration service. type RegistrationServer interface { Register(context.Context, *RegisterRequest) (*Empty, error) } // UnimplementedRegistrationServer can be embedded to have forward compatible implementations. type UnimplementedRegistrationServer struct { } func (*UnimplementedRegistrationServer) Register(ctx context.Context, req *RegisterRequest) (*Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") } func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) { 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: "/v1beta1.Registration/Register", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RegistrationServer).Register(ctx, req.(*RegisterRequest)) } return interceptor(ctx, in, info, handler) } var _Registration_serviceDesc = grpc.ServiceDesc{ ServiceName: "v1beta1.Registration", HandlerType: (*RegistrationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Registration_Register_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } // DevicePluginClient is the client API for DevicePlugin service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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) (DevicePlugin_ListAndWatchClient, 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.ClientConn } func NewDevicePluginClient(cc *grpc.ClientConn) DevicePluginClient { return &devicePluginClient{cc} } func (c *devicePluginClient) GetDevicePluginOptions(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DevicePluginOptions, error) { out := new(DevicePluginOptions) err := c.cc.Invoke(ctx, "/v1beta1.DevicePlugin/GetDevicePluginOptions", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *devicePluginClient) ListAndWatch(ctx context.Context, in *Empty, opts ...grpc.CallOption) (DevicePlugin_ListAndWatchClient, error) { stream, err := c.cc.NewStream(ctx, &_DevicePlugin_serviceDesc.Streams[0], "/v1beta1.DevicePlugin/ListAndWatch", opts...) if err != nil { return nil, err } x := &devicePluginListAndWatchClient{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 } type DevicePlugin_ListAndWatchClient interface { Recv() (*ListAndWatchResponse, error) grpc.ClientStream } type devicePluginListAndWatchClient struct { grpc.ClientStream } func (x *devicePluginListAndWatchClient) Recv() (*ListAndWatchResponse, error) { m := new(ListAndWatchResponse) if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err } return m, nil } func (c *devicePluginClient) GetPreferredAllocation(ctx context.Context, in *PreferredAllocationRequest, opts ...grpc.CallOption) (*PreferredAllocationResponse, error) { out := new(PreferredAllocationResponse) err := c.cc.Invoke(ctx, "/v1beta1.DevicePlugin/GetPreferredAllocation", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *devicePluginClient) Allocate(ctx context.Context, in *AllocateRequest, opts ...grpc.CallOption) (*AllocateResponse, error) { out := new(AllocateResponse) err := c.cc.Invoke(ctx, "/v1beta1.DevicePlugin/Allocate", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *devicePluginClient) PreStartContainer(ctx context.Context, in *PreStartContainerRequest, opts ...grpc.CallOption) (*PreStartContainerResponse, error) { out := new(PreStartContainerResponse) err := c.cc.Invoke(ctx, "/v1beta1.DevicePlugin/PreStartContainer", in, out, opts...) if err != nil { return nil, err } return out, nil } // DevicePluginServer is the server API for DevicePlugin service. 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, DevicePlugin_ListAndWatchServer) 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) } // UnimplementedDevicePluginServer can be embedded to have forward compatible implementations. type UnimplementedDevicePluginServer struct { } func (*UnimplementedDevicePluginServer) GetDevicePluginOptions(ctx context.Context, req *Empty) (*DevicePluginOptions, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDevicePluginOptions not implemented") } func (*UnimplementedDevicePluginServer) ListAndWatch(req *Empty, srv DevicePlugin_ListAndWatchServer) error { return status.Errorf(codes.Unimplemented, "method ListAndWatch not implemented") } func (*UnimplementedDevicePluginServer) GetPreferredAllocation(ctx context.Context, req *PreferredAllocationRequest) (*PreferredAllocationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPreferredAllocation not implemented") } func (*UnimplementedDevicePluginServer) Allocate(ctx context.Context, req *AllocateRequest) (*AllocateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Allocate not implemented") } func (*UnimplementedDevicePluginServer) PreStartContainer(ctx context.Context, req *PreStartContainerRequest) (*PreStartContainerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PreStartContainer not implemented") } func RegisterDevicePluginServer(s *grpc.Server, srv DevicePluginServer) { 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: "/v1beta1.DevicePlugin/GetDevicePluginOptions", } 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, &devicePluginListAndWatchServer{stream}) } type DevicePlugin_ListAndWatchServer interface { Send(*ListAndWatchResponse) error grpc.ServerStream } type devicePluginListAndWatchServer struct { grpc.ServerStream } func (x *devicePluginListAndWatchServer) Send(m *ListAndWatchResponse) error { return x.ServerStream.SendMsg(m) } 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: "/v1beta1.DevicePlugin/GetPreferredAllocation", } 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: "/v1beta1.DevicePlugin/Allocate", } 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: "/v1beta1.DevicePlugin/PreStartContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DevicePluginServer).PreStartContainer(ctx, req.(*PreStartContainerRequest)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *DevicePluginOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DevicePluginOptions) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DevicePluginOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.GetPreferredAllocationAvailable { i-- if m.GetPreferredAllocationAvailable { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x10 } if m.PreStartRequired { i-- if m.PreStartRequired { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *RegisterRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegisterRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegisterRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Options != nil { { size, err := m.Options.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } if len(m.ResourceName) > 0 { i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName))) i-- dAtA[i] = 0x1a } if len(m.Endpoint) > 0 { i -= len(m.Endpoint) copy(dAtA[i:], m.Endpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint))) i-- dAtA[i] = 0x12 } if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) i = encodeVarintApi(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Empty) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Empty) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Empty) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ListAndWatchResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListAndWatchResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListAndWatchResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *TopologyInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *TopologyInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *TopologyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Nodes) > 0 { for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NUMANode) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NUMANode) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NUMANode) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ID != 0 { i = encodeVarintApi(dAtA, i, uint64(m.ID)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Topology != nil { { size, err := m.Topology.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if len(m.Health) > 0 { i -= len(m.Health) copy(dAtA[i:], m.Health) i = encodeVarintApi(dAtA, i, uint64(len(m.Health))) i-- dAtA[i] = 0x12 } if len(m.ID) > 0 { i -= len(m.ID) copy(dAtA[i:], m.ID) i = encodeVarintApi(dAtA, i, uint64(len(m.ID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *PreStartContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PreStartContainerRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreStartContainerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DevicesIDs) > 0 { for iNdEx := len(m.DevicesIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DevicesIDs[iNdEx]) copy(dAtA[i:], m.DevicesIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DevicesIDs[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PreStartContainerResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PreStartContainerResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreStartContainerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *PreferredAllocationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PreferredAllocationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreferredAllocationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerRequests) > 0 { for iNdEx := len(m.ContainerRequests) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ContainerRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerPreferredAllocationRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerPreferredAllocationRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerPreferredAllocationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.AllocationSize != 0 { i = encodeVarintApi(dAtA, i, uint64(m.AllocationSize)) i-- dAtA[i] = 0x18 } if len(m.MustIncludeDeviceIDs) > 0 { for iNdEx := len(m.MustIncludeDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.MustIncludeDeviceIDs[iNdEx]) copy(dAtA[i:], m.MustIncludeDeviceIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.MustIncludeDeviceIDs[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.AvailableDeviceIDs) > 0 { for iNdEx := len(m.AvailableDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.AvailableDeviceIDs[iNdEx]) copy(dAtA[i:], m.AvailableDeviceIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.AvailableDeviceIDs[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PreferredAllocationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PreferredAllocationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PreferredAllocationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerResponses) > 0 { for iNdEx := len(m.ContainerResponses) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ContainerResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerPreferredAllocationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerPreferredAllocationResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerPreferredAllocationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DeviceIDs) > 0 { for iNdEx := len(m.DeviceIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DeviceIDs[iNdEx]) copy(dAtA[i:], m.DeviceIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceIDs[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *AllocateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocateRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerRequests) > 0 { for iNdEx := len(m.ContainerRequests) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ContainerRequests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerAllocateRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerAllocateRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerAllocateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DevicesIDs) > 0 { for iNdEx := len(m.DevicesIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DevicesIDs[iNdEx]) copy(dAtA[i:], m.DevicesIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DevicesIDs[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *CDIDevice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CDIDevice) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CDIDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *AllocateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocateResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ContainerResponses) > 0 { for iNdEx := len(m.ContainerResponses) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ContainerResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ContainerAllocateResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerAllocateResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerAllocateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.CDIDevices) > 0 { for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.CDIDevices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } } if len(m.Annotations) > 0 { for k := range m.Annotations { v := m.Annotations[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Mounts) > 0 { for iNdEx := len(m.Mounts) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Mounts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.Envs) > 0 { for k := range m.Envs { v := m.Envs[k] baseI := i i -= len(v) copy(dAtA[i:], v) i = encodeVarintApi(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Mount) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Mount) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Mount) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ReadOnly { i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x18 } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *DeviceSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DeviceSpec) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DeviceSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Permissions) > 0 { i -= len(m.Permissions) copy(dAtA[i:], m.Permissions) i = encodeVarintApi(dAtA, i, uint64(len(m.Permissions))) i-- dAtA[i] = 0x1a } if len(m.HostPath) > 0 { i -= len(m.HostPath) copy(dAtA[i:], m.HostPath) i = encodeVarintApi(dAtA, i, uint64(len(m.HostPath))) i-- dAtA[i] = 0x12 } if len(m.ContainerPath) > 0 { i -= len(m.ContainerPath) copy(dAtA[i:], m.ContainerPath) i = encodeVarintApi(dAtA, i, uint64(len(m.ContainerPath))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *DevicePluginOptions) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.PreStartRequired { n += 2 } if m.GetPreferredAllocationAvailable { n += 2 } return n } func (m *RegisterRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Version) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Endpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.ResourceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Options != nil { l = m.Options.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *Empty) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ListAndWatchResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *TopologyInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Nodes) > 0 { for _, e := range m.Nodes { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NUMANode) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ID != 0 { n += 1 + sovApi(uint64(m.ID)) } return n } func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ID) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Health) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Topology != nil { l = m.Topology.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *PreStartContainerRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.DevicesIDs) > 0 { for _, s := range m.DevicesIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *PreStartContainerResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *PreferredAllocationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.ContainerRequests) > 0 { for _, e := range m.ContainerRequests { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerPreferredAllocationRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.AvailableDeviceIDs) > 0 { for _, s := range m.AvailableDeviceIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if len(m.MustIncludeDeviceIDs) > 0 { for _, s := range m.MustIncludeDeviceIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.AllocationSize != 0 { n += 1 + sovApi(uint64(m.AllocationSize)) } return n } func (m *PreferredAllocationResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.ContainerResponses) > 0 { for _, e := range m.ContainerResponses { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerPreferredAllocationResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.DeviceIDs) > 0 { for _, s := range m.DeviceIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *AllocateRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.ContainerRequests) > 0 { for _, e := range m.ContainerRequests { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerAllocateRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.DevicesIDs) > 0 { for _, s := range m.DevicesIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *CDIDevice) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *AllocateResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.ContainerResponses) > 0 { for _, e := range m.ContainerResponses { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerAllocateResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Envs) > 0 { for k, v := range m.Envs { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.Mounts) > 0 { for _, e := range m.Mounts { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.Annotations) > 0 { for k, v := range m.Annotations { _ = k _ = v mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + 1 + len(v) + sovApi(uint64(len(v))) n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } if len(m.CDIDevices) > 0 { for _, e := range m.CDIDevices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *Mount) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.ReadOnly { n += 2 } return n } func (m *DeviceSpec) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ContainerPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.HostPath) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Permissions) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *DevicePluginOptions) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DevicePluginOptions{`, `PreStartRequired:` + fmt.Sprintf("%v", this.PreStartRequired) + `,`, `GetPreferredAllocationAvailable:` + fmt.Sprintf("%v", this.GetPreferredAllocationAvailable) + `,`, `}`, }, "") return s } func (this *RegisterRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegisterRequest{`, `Version:` + fmt.Sprintf("%v", this.Version) + `,`, `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `Options:` + strings.Replace(this.Options.String(), "DevicePluginOptions", "DevicePluginOptions", 1) + `,`, `}`, }, "") return s } func (this *Empty) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Empty{`, `}`, }, "") return s } func (this *ListAndWatchResponse) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*Device{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," } repeatedStringForDevices += "}" s := strings.Join([]string{`&ListAndWatchResponse{`, `Devices:` + repeatedStringForDevices + `,`, `}`, }, "") return s } func (this *TopologyInfo) String() string { if this == nil { return "nil" } repeatedStringForNodes := "[]*NUMANode{" for _, f := range this.Nodes { repeatedStringForNodes += strings.Replace(f.String(), "NUMANode", "NUMANode", 1) + "," } repeatedStringForNodes += "}" s := strings.Join([]string{`&TopologyInfo{`, `Nodes:` + repeatedStringForNodes + `,`, `}`, }, "") return s } func (this *NUMANode) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NUMANode{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Health:` + fmt.Sprintf("%v", this.Health) + `,`, `Topology:` + strings.Replace(this.Topology.String(), "TopologyInfo", "TopologyInfo", 1) + `,`, `}`, }, "") return s } func (this *PreStartContainerRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PreStartContainerRequest{`, `DevicesIDs:` + fmt.Sprintf("%v", this.DevicesIDs) + `,`, `}`, }, "") return s } func (this *PreStartContainerResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PreStartContainerResponse{`, `}`, }, "") return s } func (this *PreferredAllocationRequest) String() string { if this == nil { return "nil" } repeatedStringForContainerRequests := "[]*ContainerPreferredAllocationRequest{" for _, f := range this.ContainerRequests { repeatedStringForContainerRequests += strings.Replace(f.String(), "ContainerPreferredAllocationRequest", "ContainerPreferredAllocationRequest", 1) + "," } repeatedStringForContainerRequests += "}" s := strings.Join([]string{`&PreferredAllocationRequest{`, `ContainerRequests:` + repeatedStringForContainerRequests + `,`, `}`, }, "") return s } func (this *ContainerPreferredAllocationRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerPreferredAllocationRequest{`, `AvailableDeviceIDs:` + fmt.Sprintf("%v", this.AvailableDeviceIDs) + `,`, `MustIncludeDeviceIDs:` + fmt.Sprintf("%v", this.MustIncludeDeviceIDs) + `,`, `AllocationSize:` + fmt.Sprintf("%v", this.AllocationSize) + `,`, `}`, }, "") return s } func (this *PreferredAllocationResponse) String() string { if this == nil { return "nil" } repeatedStringForContainerResponses := "[]*ContainerPreferredAllocationResponse{" for _, f := range this.ContainerResponses { repeatedStringForContainerResponses += strings.Replace(f.String(), "ContainerPreferredAllocationResponse", "ContainerPreferredAllocationResponse", 1) + "," } repeatedStringForContainerResponses += "}" s := strings.Join([]string{`&PreferredAllocationResponse{`, `ContainerResponses:` + repeatedStringForContainerResponses + `,`, `}`, }, "") return s } func (this *ContainerPreferredAllocationResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerPreferredAllocationResponse{`, `DeviceIDs:` + fmt.Sprintf("%v", this.DeviceIDs) + `,`, `}`, }, "") return s } func (this *AllocateRequest) String() string { if this == nil { return "nil" } repeatedStringForContainerRequests := "[]*ContainerAllocateRequest{" for _, f := range this.ContainerRequests { repeatedStringForContainerRequests += strings.Replace(f.String(), "ContainerAllocateRequest", "ContainerAllocateRequest", 1) + "," } repeatedStringForContainerRequests += "}" s := strings.Join([]string{`&AllocateRequest{`, `ContainerRequests:` + repeatedStringForContainerRequests + `,`, `}`, }, "") return s } func (this *ContainerAllocateRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerAllocateRequest{`, `DevicesIDs:` + fmt.Sprintf("%v", this.DevicesIDs) + `,`, `}`, }, "") return s } func (this *CDIDevice) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CDIDevice{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") return s } func (this *AllocateResponse) String() string { if this == nil { return "nil" } repeatedStringForContainerResponses := "[]*ContainerAllocateResponse{" for _, f := range this.ContainerResponses { repeatedStringForContainerResponses += strings.Replace(f.String(), "ContainerAllocateResponse", "ContainerAllocateResponse", 1) + "," } repeatedStringForContainerResponses += "}" s := strings.Join([]string{`&AllocateResponse{`, `ContainerResponses:` + repeatedStringForContainerResponses + `,`, `}`, }, "") return s } func (this *ContainerAllocateResponse) String() string { if this == nil { return "nil" } repeatedStringForMounts := "[]*Mount{" for _, f := range this.Mounts { repeatedStringForMounts += strings.Replace(f.String(), "Mount", "Mount", 1) + "," } repeatedStringForMounts += "}" repeatedStringForDevices := "[]*DeviceSpec{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "DeviceSpec", "DeviceSpec", 1) + "," } repeatedStringForDevices += "}" repeatedStringForCDIDevices := "[]*CDIDevice{" for _, f := range this.CDIDevices { repeatedStringForCDIDevices += strings.Replace(f.String(), "CDIDevice", "CDIDevice", 1) + "," } repeatedStringForCDIDevices += "}" keysForEnvs := make([]string, 0, len(this.Envs)) for k := range this.Envs { keysForEnvs = append(keysForEnvs, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForEnvs) mapStringForEnvs := "map[string]string{" for _, k := range keysForEnvs { mapStringForEnvs += fmt.Sprintf("%v: %v,", k, this.Envs[k]) } mapStringForEnvs += "}" keysForAnnotations := make([]string, 0, len(this.Annotations)) for k := range this.Annotations { keysForAnnotations = append(keysForAnnotations, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) mapStringForAnnotations := "map[string]string{" for _, k := range keysForAnnotations { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" s := strings.Join([]string{`&ContainerAllocateResponse{`, `Envs:` + mapStringForEnvs + `,`, `Mounts:` + repeatedStringForMounts + `,`, `Devices:` + repeatedStringForDevices + `,`, `Annotations:` + mapStringForAnnotations + `,`, `CDIDevices:` + repeatedStringForCDIDevices + `,`, `}`, }, "") return s } func (this *Mount) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Mount{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `ReadOnly:` + fmt.Sprintf("%v", this.ReadOnly) + `,`, `}`, }, "") return s } func (this *DeviceSpec) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&DeviceSpec{`, `ContainerPath:` + fmt.Sprintf("%v", this.ContainerPath) + `,`, `HostPath:` + fmt.Sprintf("%v", this.HostPath) + `,`, `Permissions:` + fmt.Sprintf("%v", this.Permissions) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *DevicePluginOptions) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DevicePluginOptions: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DevicePluginOptions: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PreStartRequired", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.PreStartRequired = bool(v != 0) case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field GetPreferredAllocationAvailable", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.GetPreferredAllocationAvailable = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegisterRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegisterRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegisterRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Version = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Options == nil { m.Options = &DevicePluginOptions{} } if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Empty) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Empty: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Empty: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListAndWatchResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListAndWatchResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListAndWatchResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *TopologyInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: TopologyInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TopologyInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Nodes = append(m.Nodes, &NUMANode{}) if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NUMANode) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NUMANode: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NUMANode: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Health", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Health = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Topology == nil { m.Topology = &TopologyInfo{} } if err := m.Topology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PreStartContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PreStartContainerRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PreStartContainerRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DevicesIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DevicesIDs = append(m.DevicesIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PreStartContainerResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PreStartContainerResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PreStartContainerResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PreferredAllocationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PreferredAllocationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PreferredAllocationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerRequests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerRequests = append(m.ContainerRequests, &ContainerPreferredAllocationRequest{}) if err := m.ContainerRequests[len(m.ContainerRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerPreferredAllocationRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerPreferredAllocationRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerPreferredAllocationRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AvailableDeviceIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.AvailableDeviceIDs = append(m.AvailableDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MustIncludeDeviceIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.MustIncludeDeviceIDs = append(m.MustIncludeDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AllocationSize", wireType) } m.AllocationSize = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.AllocationSize |= int32(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PreferredAllocationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PreferredAllocationResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PreferredAllocationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerResponses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerResponses = append(m.ContainerResponses, &ContainerPreferredAllocationResponse{}) if err := m.ContainerResponses[len(m.ContainerResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerPreferredAllocationResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerPreferredAllocationResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerPreferredAllocationResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceIDs = append(m.DeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AllocateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerRequests", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerRequests = append(m.ContainerRequests, &ContainerAllocateRequest{}) if err := m.ContainerRequests[len(m.ContainerRequests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerAllocateRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerAllocateRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerAllocateRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DevicesIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DevicesIDs = append(m.DevicesIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CDIDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CDIDevice: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CDIDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AllocateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerResponses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerResponses = append(m.ContainerResponses, &ContainerAllocateResponse{}) if err := m.ContainerResponses[len(m.ContainerResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerAllocateResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerAllocateResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerAllocateResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Envs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Envs == nil { m.Envs = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Envs[mapkey] = mapvalue iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Mounts", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Mounts = append(m.Mounts, &Mount{}) if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &DeviceSpec{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Annotations == nil { m.Annotations = make(map[string]string) } var mapkey string var mapvalue string for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapvalue |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { return ErrInvalidLengthApi } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { return ErrInvalidLengthApi } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF } mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Annotations[mapkey] = mapvalue iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CDIDevices = append(m.CDIDevices, &CDIDevice{}) if err := m.CDIDevices[len(m.CDIDevices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Mount) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Mount: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Mount: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ReadOnly", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.ReadOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DeviceSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DeviceSpec: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DeviceSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ContainerPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ContainerPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HostPath", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.HostPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Permissions = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1beta1/api.proto000066400000000000000000000203271503561374700247170ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package v1beta1; option go_package = "k8s.io/kubelet/pkg/apis/deviceplugin/v1beta1"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; // Registration is the service advertised by the Kubelet // Only when Kubelet answers with a success code to a Register Request // may Device Plugins start their service // Registration may fail when device plugin version is not supported by // Kubelet or the registered resourceName is already taken by another // active device plugin. Device plugin is expected to terminate upon registration failure service Registration { rpc Register(RegisterRequest) returns (Empty) {} } message DevicePluginOptions { // Indicates if PreStartContainer call is required before each container start bool pre_start_required = 1; // Indicates if GetPreferredAllocation is implemented and available for calling bool get_preferred_allocation_available = 2; } message RegisterRequest { // Version of the API the Device Plugin was built against string version = 1; // Name of the unix socket the device plugin is listening on // PATH = path.Join(DevicePluginPath, endpoint) string endpoint = 2; // Schedulable resource name. As of now it's expected to be a DNS Label string resource_name = 3; // Options to be communicated with Device Manager DevicePluginOptions options = 4; } message Empty { } // DevicePlugin is the service advertised by Device Plugins service DevicePlugin { // GetDevicePluginOptions returns options to be communicated with Device // Manager rpc GetDevicePluginOptions(Empty) returns (DevicePluginOptions) {} // ListAndWatch returns a stream of List of Devices // Whenever a Device state change or a Device disappears, ListAndWatch // returns the new list rpc ListAndWatch(Empty) returns (stream ListAndWatchResponse) {} // GetPreferredAllocation returns a preferred set of devices to allocate // from a list of available ones. The resulting preferred allocation is not // guaranteed to be the allocation ultimately performed by the // devicemanager. It is only designed to help the devicemanager make a more // informed allocation decision when possible. rpc GetPreferredAllocation(PreferredAllocationRequest) returns (PreferredAllocationResponse) {} // Allocate is called during container creation so that the Device // Plugin can run device specific operations and instruct Kubelet // of the steps to make the Device available in the container rpc Allocate(AllocateRequest) returns (AllocateResponse) {} // PreStartContainer is called, if indicated by Device Plugin during registeration phase, // before each container start. Device plugin can run device specific operations // such as resetting the device before making devices available to the container rpc PreStartContainer(PreStartContainerRequest) returns (PreStartContainerResponse) {} } // ListAndWatch returns a stream of List of Devices // Whenever a Device state change or a Device disappears, ListAndWatch // returns the new list message ListAndWatchResponse { repeated Device devices = 1; } message TopologyInfo { repeated NUMANode nodes = 1; } message NUMANode { int64 ID = 1; } /* E.g: * struct Device { * ID: "GPU-fef8089b-4820-abfc-e83e-94318197576e", * Health: "Healthy", * Topology: * Node: * ID: 1 *} */ message Device { // A unique ID assigned by the device plugin used // to identify devices during the communication // Max length of this field is 63 characters string ID = 1; // Health of the device, can be healthy or unhealthy, see constants.go string health = 2; // Topology for device TopologyInfo topology = 3; } // - PreStartContainer is expected to be called before each container start if indicated by plugin during registration phase. // - PreStartContainer allows kubelet to pass reinitialized devices to containers. // - PreStartContainer allows Device Plugin to run device specific operations on // the Devices requested message PreStartContainerRequest { repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"]; } // PreStartContainerResponse will be send by plugin in response to PreStartContainerRequest message PreStartContainerResponse { } // PreferredAllocationRequest is passed via a call to GetPreferredAllocation() // at pod admission time. The device plugin should take the list of // `available_deviceIDs` and calculate a preferred allocation of size // 'allocation_size' from them, making sure to include the set of devices // listed in 'must_include_deviceIDs'. message PreferredAllocationRequest { repeated ContainerPreferredAllocationRequest container_requests = 1; } message ContainerPreferredAllocationRequest { // List of available deviceIDs from which to choose a preferred allocation repeated string available_deviceIDs = 1; // List of deviceIDs that must be included in the preferred allocation repeated string must_include_deviceIDs = 2; // Number of devices to include in the preferred allocation int32 allocation_size = 3; } // PreferredAllocationResponse returns a preferred allocation, // resulting from a PreferredAllocationRequest. message PreferredAllocationResponse { repeated ContainerPreferredAllocationResponse container_responses = 1; } message ContainerPreferredAllocationResponse { repeated string deviceIDs = 1; } // - Allocate is expected to be called during pod creation since allocation // failures for any container would result in pod startup failure. // - Allocate allows kubelet to exposes additional artifacts in a pod's // environment as directed by the plugin. // - Allocate allows Device Plugin to run device specific operations on // the Devices requested message AllocateRequest { repeated ContainerAllocateRequest container_requests = 1; } message ContainerAllocateRequest { repeated string devices_ids = 1 [(gogoproto.customname) = "DevicesIDs"]; } // CDIDevice specifies a CDI device information. message CDIDevice { // Fully qualified CDI device name // for example: vendor.com/gpu=gpudevice1 // see more details in the CDI specification: // https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md string name = 1; } // AllocateResponse includes the artifacts that needs to be injected into // a container for accessing 'deviceIDs' that were mentioned as part of // 'AllocateRequest'. // Failure Handling: // if Kubelet sends an allocation request for dev1 and dev2. // Allocation on dev1 succeeds but allocation on dev2 fails. // The Device plugin should send a ListAndWatch update and fail the // Allocation request message AllocateResponse { repeated ContainerAllocateResponse container_responses = 1; } message ContainerAllocateResponse { // List of environment variable to be set in the container to access one of more devices. map envs = 1; // Mounts for the container. repeated Mount mounts = 2; // Devices for the container. repeated DeviceSpec devices = 3; // Container annotations to pass to the container runtime map annotations = 4; // CDI devices for the container. repeated CDIDevice cdi_devices = 5 [(gogoproto.customname) = "CDIDevices"]; } // Mount specifies a host volume to mount into a container. // where device library or tools are installed on host and container message Mount { // Path of the mount within the container. string container_path = 1; // Path of the mount on the host. string host_path = 2; // If set, the mount is read-only. bool read_only = 3; } // DeviceSpec specifies a host device to mount into a container. message DeviceSpec { // Path of the device within the container. string container_path = 1; // Path of the device on the host. string host_path = 2; // Cgroups permissions of the device, candidates are one or more of // * r - allows container to read from the specified device. // * w - allows container to write to the specified device. // * m - allows container to create device files that do not yet exist. string permissions = 3; } kubelet-kubernetes-1.32.7/pkg/apis/deviceplugin/v1beta1/constants.go000066400000000000000000000037041503561374700254240ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 const ( // Healthy means that the device is healthy Healthy = "Healthy" // Unhealthy means that the device is unhealthy Unhealthy = "Unhealthy" // Version means current version of the API supported by kubelet Version = "v1beta1" // DevicePluginPath is the folder the Device Plugin is expecting sockets to be on // Only privileged pods have access to this path // Note: Placeholder until we find a "standard path" DevicePluginPath = "/var/lib/kubelet/device-plugins/" // KubeletSocket is the path of the Kubelet registry socket KubeletSocket = DevicePluginPath + "kubelet.sock" // DevicePluginPathWindows Avoid failed to run Kubelet: bad socketPath, // must be an absolute path: /var/lib/kubelet/device-plugins/kubelet.sock // https://github.com/kubernetes/kubernetes/issues/93262 // https://github.com/kubernetes/kubernetes/pull/93285#discussion_r458140701 DevicePluginPathWindows = "\\var\\lib\\kubelet\\device-plugins\\" // KubeletSocketWindows is the path of the Kubelet registry socket on windows KubeletSocketWindows = DevicePluginPathWindows + "kubelet.sock" // KubeletPreStartContainerRPCTimeoutInSecs is the timeout duration in secs for PreStartContainer RPC // Timeout duration in secs for PreStartContainer RPC KubeletPreStartContainerRPCTimeoutInSecs = 30 ) // SupportedVersions provides a list of supported version var SupportedVersions = [...]string{"v1beta1"} kubelet-kubernetes-1.32.7/pkg/apis/dra/000077500000000000000000000000001503561374700177025ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/dra/OWNERS000066400000000000000000000002571503561374700206460ustar00rootroot00000000000000# See the OWNERS docs at https://go.k8s.io/owners approvers: - klueska - pohly reviewers: - klueska - pohly - bart0sh labels: - sig/node - wg/device-management kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/000077500000000000000000000000001503561374700213225ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/api.pb.go000066400000000000000000001757111503561374700230360ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1alpha4 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type NodePrepareResourcesRequest struct { // The list of ResourceClaims that are to be prepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodePrepareResourcesRequest) Reset() { *m = NodePrepareResourcesRequest{} } func (*NodePrepareResourcesRequest) ProtoMessage() {} func (*NodePrepareResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *NodePrepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourcesRequest.Merge(m, src) } func (m *NodePrepareResourcesRequest) XXX_Size() int { return m.Size() } func (m *NodePrepareResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourcesRequest proto.InternalMessageInfo func (m *NodePrepareResourcesRequest) GetClaims() []*Claim { if m != nil { return m.Claims } return nil } type NodePrepareResourcesResponse struct { // The ResourceClaims for which preparation was done // or attempted, with claim_uid as key. // // It is an error if some claim listed in NodePrepareResourcesRequest // does not get prepared. NodePrepareResources // will be called again for those that are missing. Claims map[string]*NodePrepareResourceResponse `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:"-"` } func (m *NodePrepareResourcesResponse) Reset() { *m = NodePrepareResourcesResponse{} } func (*NodePrepareResourcesResponse) ProtoMessage() {} func (*NodePrepareResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *NodePrepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourcesResponse.Merge(m, src) } func (m *NodePrepareResourcesResponse) XXX_Size() int { return m.Size() } func (m *NodePrepareResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourcesResponse proto.InternalMessageInfo func (m *NodePrepareResourcesResponse) GetClaims() map[string]*NodePrepareResourceResponse { if m != nil { return m.Claims } return nil } type NodePrepareResourceResponse struct { // These are the additional devices that kubelet must // make available via the container runtime. A claim // may have zero or more requests and each request // may have zero or more devices. Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` // If non-empty, preparing the ResourceClaim failed. // Devices are ignored in that case. Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodePrepareResourceResponse) Reset() { *m = NodePrepareResourceResponse{} } func (*NodePrepareResourceResponse) ProtoMessage() {} func (*NodePrepareResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *NodePrepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourceResponse.Merge(m, src) } func (m *NodePrepareResourceResponse) XXX_Size() int { return m.Size() } func (m *NodePrepareResourceResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourceResponse.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourceResponse proto.InternalMessageInfo func (m *NodePrepareResourceResponse) GetDevices() []*Device { if m != nil { return m.Devices } return nil } func (m *NodePrepareResourceResponse) GetError() string { if m != nil { return m.Error } return "" } type Device struct { // The requests in the claim that this device is associated with. // Optional. If empty, the device is associated with all requests. RequestNames []string `protobuf:"bytes,1,rep,name=request_names,json=requestNames,proto3" json:"request_names,omitempty"` // The pool which contains the device. Required. PoolName string `protobuf:"bytes,2,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` // The device itself. Required. DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` // A single device instance may map to several CDI device IDs. // None is also valid. CDIDeviceIDs []string `protobuf:"bytes,4,rep,name=cdi_device_ids,json=cdiDeviceIds,proto3" json:"cdi_device_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Device.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Device) XXX_Merge(src proto.Message) { xxx_messageInfo_Device.Merge(m, src) } func (m *Device) XXX_Size() int { return m.Size() } func (m *Device) XXX_DiscardUnknown() { xxx_messageInfo_Device.DiscardUnknown(m) } var xxx_messageInfo_Device proto.InternalMessageInfo func (m *Device) GetRequestNames() []string { if m != nil { return m.RequestNames } return nil } func (m *Device) GetPoolName() string { if m != nil { return m.PoolName } return "" } func (m *Device) GetDeviceName() string { if m != nil { return m.DeviceName } return "" } func (m *Device) GetCDIDeviceIDs() []string { if m != nil { return m.CDIDeviceIDs } return nil } type NodeUnprepareResourcesRequest struct { // The list of ResourceClaims that are to be unprepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodeUnprepareResourcesRequest) Reset() { *m = NodeUnprepareResourcesRequest{} } func (*NodeUnprepareResourcesRequest) ProtoMessage() {} func (*NodeUnprepareResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *NodeUnprepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourcesRequest.Merge(m, src) } func (m *NodeUnprepareResourcesRequest) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourcesRequest proto.InternalMessageInfo func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim { if m != nil { return m.Claims } return nil } type NodeUnprepareResourcesResponse struct { // The ResourceClaims for which preparation was reverted. // The same rules as for NodePrepareResourcesResponse.claims // apply. 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:"-"` } func (m *NodeUnprepareResourcesResponse) Reset() { *m = NodeUnprepareResourcesResponse{} } func (*NodeUnprepareResourcesResponse) ProtoMessage() {} func (*NodeUnprepareResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NodeUnprepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourcesResponse.Merge(m, src) } func (m *NodeUnprepareResourcesResponse) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourcesResponse proto.InternalMessageInfo func (m *NodeUnprepareResourcesResponse) GetClaims() map[string]*NodeUnprepareResourceResponse { if m != nil { return m.Claims } return nil } type NodeUnprepareResourceResponse struct { // If non-empty, unpreparing the ResourceClaim failed. Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodeUnprepareResourceResponse) Reset() { *m = NodeUnprepareResourceResponse{} } func (*NodeUnprepareResourceResponse) ProtoMessage() {} func (*NodeUnprepareResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *NodeUnprepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourceResponse.Merge(m, src) } func (m *NodeUnprepareResourceResponse) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourceResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourceResponse.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourceResponse proto.InternalMessageInfo func (m *NodeUnprepareResourceResponse) GetError() string { if m != nil { return m.Error } return "" } type Claim struct { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. UID string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Claim) Reset() { *m = Claim{} } func (*Claim) ProtoMessage() {} func (*Claim) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *Claim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Claim.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Claim) XXX_Merge(src proto.Message) { xxx_messageInfo_Claim.Merge(m, src) } func (m *Claim) XXX_Size() int { return m.Size() } func (m *Claim) XXX_DiscardUnknown() { xxx_messageInfo_Claim.DiscardUnknown(m) } var xxx_messageInfo_Claim proto.InternalMessageInfo func (m *Claim) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *Claim) GetUID() string { if m != nil { return m.UID } return "" } func (m *Claim) GetName() string { if m != nil { return m.Name } return "" } 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") } 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, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // NodeClient is the client API for Node 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 { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the // response is ignored. Failures for individual claims // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) } type nodeClient struct { cc *grpc.ClientConn } func NewNodeClient(cc *grpc.ClientConn) NodeClient { return &nodeClient{cc} } func (c *nodeClient) 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...) if err != nil { return nil, err } return out, nil } func (c *nodeClient) 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...) if err != nil { return nil, err } return out, nil } // NodeServer is the server API for Node service. type NodeServer interface { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the // response is ignored. Failures for individual claims // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(context.Context, *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(context.Context, *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) } // UnimplementedNodeServer can be embedded to have forward compatible implementations. type UnimplementedNodeServer struct { } func (*UnimplementedNodeServer) 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) { return nil, status.Errorf(codes.Unimplemented, "method NodeUnprepareResources not implemented") } func RegisterNodeServer(s *grpc.Server, srv NodeServer) { s.RegisterService(&_Node_serviceDesc, srv) } func _Node_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) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/v1alpha3.Node/NodePrepareResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).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) { in := new(NodeUnprepareResourcesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(NodeServer).NodeUnprepareResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/v1alpha3.Node/NodeUnprepareResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).NodeUnprepareResources(ctx, req.(*NodeUnprepareResourcesRequest)) } return interceptor(ctx, in, info, handler) } var _Node_serviceDesc = grpc.ServiceDesc{ ServiceName: "v1alpha3.Node", HandlerType: (*NodeServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "NodePrepareResources", Handler: _Node_NodePrepareResources_Handler, }, { MethodName: "NodeUnprepareResources", Handler: _Node_NodeUnprepareResources_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } func (m *NodePrepareResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodePrepareResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for k := range m.Claims { v := m.Claims[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodePrepareResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.CDIDeviceIDs) > 0 { for iNdEx := len(m.CDIDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.CDIDeviceIDs[iNdEx]) copy(dAtA[i:], m.CDIDeviceIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDeviceIDs[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.DeviceName) > 0 { i -= len(m.DeviceName) copy(dAtA[i:], m.DeviceName) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) i-- dAtA[i] = 0x1a } if len(m.PoolName) > 0 { i -= len(m.PoolName) copy(dAtA[i:], m.PoolName) i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) i-- dAtA[i] = 0x12 } if len(m.RequestNames) > 0 { for iNdEx := len(m.RequestNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RequestNames[iNdEx]) copy(dAtA[i:], m.RequestNames[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.RequestNames[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for k := range m.Claims { v := m.Claims[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Claim) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Claim) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if len(m.UID) > 0 { i -= len(m.UID) copy(dAtA[i:], m.UID) i = encodeVarintApi(dAtA, i, uint64(len(m.UID))) i-- dAtA[i] = 0x12 } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *NodePrepareResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for _, e := range m.Claims { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodePrepareResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for k, v := range m.Claims { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovApi(uint64(l)) } mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *NodePrepareResourceResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.RequestNames) > 0 { for _, s := range m.RequestNames { l = len(s) n += 1 + l + sovApi(uint64(l)) } } l = len(m.PoolName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.DeviceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.CDIDeviceIDs) > 0 { for _, s := range m.CDIDeviceIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodeUnprepareResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for _, e := range m.Claims { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodeUnprepareResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for k, v := range m.Claims { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovApi(uint64(l)) } mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *NodeUnprepareResourceResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Claim) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.UID) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *NodePrepareResourcesRequest) String() string { if this == nil { return "nil" } repeatedStringForClaims := "[]*Claim{" for _, f := range this.Claims { repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," } repeatedStringForClaims += "}" s := strings.Join([]string{`&NodePrepareResourcesRequest{`, `Claims:` + repeatedStringForClaims + `,`, `}`, }, "") return s } func (this *NodePrepareResourcesResponse) String() string { if this == nil { return "nil" } keysForClaims := make([]string, 0, len(this.Claims)) for k := range this.Claims { keysForClaims = append(keysForClaims, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) mapStringForClaims := "map[string]*NodePrepareResourceResponse{" for _, k := range keysForClaims { mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) } mapStringForClaims += "}" s := strings.Join([]string{`&NodePrepareResourcesResponse{`, `Claims:` + mapStringForClaims + `,`, `}`, }, "") return s } func (this *NodePrepareResourceResponse) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*Device{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," } repeatedStringForDevices += "}" s := strings.Join([]string{`&NodePrepareResourceResponse{`, `Devices:` + repeatedStringForDevices + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `RequestNames:` + fmt.Sprintf("%v", this.RequestNames) + `,`, `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, `CDIDeviceIDs:` + fmt.Sprintf("%v", this.CDIDeviceIDs) + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourcesRequest) String() string { if this == nil { return "nil" } repeatedStringForClaims := "[]*Claim{" for _, f := range this.Claims { repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," } repeatedStringForClaims += "}" s := strings.Join([]string{`&NodeUnprepareResourcesRequest{`, `Claims:` + repeatedStringForClaims + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourcesResponse) String() string { if this == nil { return "nil" } keysForClaims := make([]string, 0, len(this.Claims)) for k := range this.Claims { keysForClaims = append(keysForClaims, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) mapStringForClaims := "map[string]*NodeUnprepareResourceResponse{" for _, k := range keysForClaims { mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) } mapStringForClaims += "}" s := strings.Join([]string{`&NodeUnprepareResourcesResponse{`, `Claims:` + mapStringForClaims + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourceResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NodeUnprepareResourceResponse{`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *Claim) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Claim{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *NodePrepareResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Claims = append(m.Claims, &Claim{}) if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodePrepareResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Claims == nil { m.Claims = make(map[string]*NodePrepareResourceResponse) } var mapkey string var mapvalue *NodePrepareResourceResponse for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthApi } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthApi } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &NodePrepareResourceResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Claims[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RequestNames = append(m.RequestNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PoolName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CDIDeviceIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CDIDeviceIDs = append(m.CDIDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Claims = append(m.Claims, &Claim{}) if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Claims == nil { m.Claims = make(map[string]*NodeUnprepareResourceResponse) } var mapkey string var mapvalue *NodeUnprepareResourceResponse for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthApi } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthApi } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &NodeUnprepareResourceResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Claims[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Claim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Claim: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.UID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/api.proto000066400000000000000000000077021503561374700231660ustar00rootroot00000000000000/* Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package v1alpha3; option go_package = "k8s.io/kubelet/pkg/apis/dra/v1alpha4"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; service Node { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the // response is ignored. Failures for individual claims // can be reported inside NodePrepareResourcesResponse. rpc NodePrepareResources (NodePrepareResourcesRequest) returns (NodePrepareResourcesResponse) {} // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, rpc NodeUnprepareResources (NodeUnprepareResourcesRequest) returns (NodeUnprepareResourcesResponse) {} } message NodePrepareResourcesRequest { // The list of ResourceClaims that are to be prepared. repeated Claim claims = 1; } message NodePrepareResourcesResponse { // The ResourceClaims for which preparation was done // or attempted, with claim_uid as key. // // It is an error if some claim listed in NodePrepareResourcesRequest // does not get prepared. NodePrepareResources // will be called again for those that are missing. map claims = 1; } message NodePrepareResourceResponse { // These are the additional devices that kubelet must // make available via the container runtime. A claim // may have zero or more requests and each request // may have zero or more devices. repeated Device devices = 1; // If non-empty, preparing the ResourceClaim failed. // Devices are ignored in that case. string error = 2; } message Device { // The requests in the claim that this device is associated with. // Optional. If empty, the device is associated with all requests. repeated string request_names = 1; // The pool which contains the device. Required. string pool_name = 2; // The device itself. Required. string device_name = 3; // A single device instance may map to several CDI device IDs. // None is also valid. repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"]; } message NodeUnprepareResourcesRequest { // The list of ResourceClaims that are to be unprepared. repeated Claim claims = 1; } message NodeUnprepareResourcesResponse { // The ResourceClaims for which preparation was reverted. // The same rules as for NodePrepareResourcesResponse.claims // apply. map claims = 1; } message NodeUnprepareResourceResponse { // If non-empty, unpreparing the ResourceClaim failed. string error = 1; } message Claim { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. string namespace = 1; // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. string uid = 2 [(gogoproto.customname) = "UID"]; // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. string name = 3; } kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/conversion.go000066400000000000000000000217621503561374700240460ustar00rootroot00000000000000/* 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 } kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/doc.go000066400000000000000000000014231503561374700224160ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Package v1alpha4 contains a legacy implementation of the DRA gRPC // interface. Support for it in kubelet is provided via conversion. // // +k8s:conversion-gen=k8s.io/kubelet/pkg/apis/dra/v1beta1 package v1alpha4 kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/types.go000066400000000000000000000020471503561374700230200ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha4 const ( // NodeService should be listed in the "supported versions" // array during plugin registration by a DRA plugin which provides // an implementation of the v1alpha3 Node service. // // This convention was introduced in Kubernetes 1.32. Older DRA // plugins provide the implementation without advertising it. // // For historic reasons (= a mistake...) there is a mismatch between // the package name and gRPC version. NodeService = "v1alpha3.NodeService" ) kubelet-kubernetes-1.32.7/pkg/apis/dra/v1alpha4/zz_generated.conversion.go000066400000000000000000000452341503561374700265260ustar00rootroot00000000000000//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) } kubelet-kubernetes-1.32.7/pkg/apis/dra/v1beta1/000077500000000000000000000000001503561374700211455ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/dra/v1beta1/api.pb.go000066400000000000000000001772361503561374700226650ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1beta1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type NodePrepareResourcesRequest struct { // The list of ResourceClaims that are to be prepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodePrepareResourcesRequest) Reset() { *m = NodePrepareResourcesRequest{} } func (*NodePrepareResourcesRequest) ProtoMessage() {} func (*NodePrepareResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *NodePrepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourcesRequest.Merge(m, src) } func (m *NodePrepareResourcesRequest) XXX_Size() int { return m.Size() } func (m *NodePrepareResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourcesRequest proto.InternalMessageInfo func (m *NodePrepareResourcesRequest) GetClaims() []*Claim { if m != nil { return m.Claims } return nil } type NodePrepareResourcesResponse struct { // The ResourceClaims for which preparation was done // or attempted, with claim_uid as key. // // It is an error if some claim listed in NodePrepareResourcesRequest // does not get prepared. NodePrepareResources // will be called again for those that are missing. Claims map[string]*NodePrepareResourceResponse `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:"-"` } func (m *NodePrepareResourcesResponse) Reset() { *m = NodePrepareResourcesResponse{} } func (*NodePrepareResourcesResponse) ProtoMessage() {} func (*NodePrepareResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *NodePrepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourcesResponse.Merge(m, src) } func (m *NodePrepareResourcesResponse) XXX_Size() int { return m.Size() } func (m *NodePrepareResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourcesResponse proto.InternalMessageInfo func (m *NodePrepareResourcesResponse) GetClaims() map[string]*NodePrepareResourceResponse { if m != nil { return m.Claims } return nil } type NodePrepareResourceResponse struct { // These are the additional devices that kubelet must // make available via the container runtime. A claim // may have zero or more requests and each request // may have zero or more devices. Devices []*Device `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` // If non-empty, preparing the ResourceClaim failed. // Devices are ignored in that case. Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodePrepareResourceResponse) Reset() { *m = NodePrepareResourceResponse{} } func (*NodePrepareResourceResponse) ProtoMessage() {} func (*NodePrepareResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *NodePrepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodePrepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodePrepareResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodePrepareResourceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodePrepareResourceResponse.Merge(m, src) } func (m *NodePrepareResourceResponse) XXX_Size() int { return m.Size() } func (m *NodePrepareResourceResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodePrepareResourceResponse.DiscardUnknown(m) } var xxx_messageInfo_NodePrepareResourceResponse proto.InternalMessageInfo func (m *NodePrepareResourceResponse) GetDevices() []*Device { if m != nil { return m.Devices } return nil } func (m *NodePrepareResourceResponse) GetError() string { if m != nil { return m.Error } return "" } type Device struct { // The requests in the claim that this device is associated with. // Optional. If empty, the device is associated with all requests. RequestNames []string `protobuf:"bytes,1,rep,name=request_names,json=requestNames,proto3" json:"request_names,omitempty"` // The pool which contains the device. Required. PoolName string `protobuf:"bytes,2,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` // The device itself. Required. DeviceName string `protobuf:"bytes,3,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` // A single device instance may map to several CDI device IDs. // None is also valid. CDIDeviceIDs []string `protobuf:"bytes,4,rep,name=cdi_device_ids,json=cdiDeviceIds,proto3" json:"cdi_device_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Device) Reset() { *m = Device{} } func (*Device) ProtoMessage() {} func (*Device) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *Device) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Device) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Device.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Device) XXX_Merge(src proto.Message) { xxx_messageInfo_Device.Merge(m, src) } func (m *Device) XXX_Size() int { return m.Size() } func (m *Device) XXX_DiscardUnknown() { xxx_messageInfo_Device.DiscardUnknown(m) } var xxx_messageInfo_Device proto.InternalMessageInfo func (m *Device) GetRequestNames() []string { if m != nil { return m.RequestNames } return nil } func (m *Device) GetPoolName() string { if m != nil { return m.PoolName } return "" } func (m *Device) GetDeviceName() string { if m != nil { return m.DeviceName } return "" } func (m *Device) GetCDIDeviceIDs() []string { if m != nil { return m.CDIDeviceIDs } return nil } type NodeUnprepareResourcesRequest struct { // The list of ResourceClaims that are to be unprepared. Claims []*Claim `protobuf:"bytes,1,rep,name=claims,proto3" json:"claims,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodeUnprepareResourcesRequest) Reset() { *m = NodeUnprepareResourcesRequest{} } func (*NodeUnprepareResourcesRequest) ProtoMessage() {} func (*NodeUnprepareResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *NodeUnprepareResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourcesRequest.Merge(m, src) } func (m *NodeUnprepareResourcesRequest) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourcesRequest proto.InternalMessageInfo func (m *NodeUnprepareResourcesRequest) GetClaims() []*Claim { if m != nil { return m.Claims } return nil } type NodeUnprepareResourcesResponse struct { // The ResourceClaims for which preparation was reverted. // The same rules as for NodePrepareResourcesResponse.claims // apply. 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:"-"` } func (m *NodeUnprepareResourcesResponse) Reset() { *m = NodeUnprepareResourcesResponse{} } func (*NodeUnprepareResourcesResponse) ProtoMessage() {} func (*NodeUnprepareResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *NodeUnprepareResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourcesResponse.Merge(m, src) } func (m *NodeUnprepareResourcesResponse) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourcesResponse proto.InternalMessageInfo func (m *NodeUnprepareResourcesResponse) GetClaims() map[string]*NodeUnprepareResourceResponse { if m != nil { return m.Claims } return nil } type NodeUnprepareResourceResponse struct { // If non-empty, unpreparing the ResourceClaim failed. Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NodeUnprepareResourceResponse) Reset() { *m = NodeUnprepareResourceResponse{} } func (*NodeUnprepareResourceResponse) ProtoMessage() {} func (*NodeUnprepareResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *NodeUnprepareResourceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NodeUnprepareResourceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NodeUnprepareResourceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NodeUnprepareResourceResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_NodeUnprepareResourceResponse.Merge(m, src) } func (m *NodeUnprepareResourceResponse) XXX_Size() int { return m.Size() } func (m *NodeUnprepareResourceResponse) XXX_DiscardUnknown() { xxx_messageInfo_NodeUnprepareResourceResponse.DiscardUnknown(m) } var xxx_messageInfo_NodeUnprepareResourceResponse proto.InternalMessageInfo func (m *NodeUnprepareResourceResponse) GetError() string { if m != nil { return m.Error } return "" } type Claim struct { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. UID string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *Claim) Reset() { *m = Claim{} } func (*Claim) ProtoMessage() {} func (*Claim) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *Claim) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Claim) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Claim.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *Claim) XXX_Merge(src proto.Message) { xxx_messageInfo_Claim.Merge(m, src) } func (m *Claim) XXX_Size() int { return m.Size() } func (m *Claim) XXX_DiscardUnknown() { xxx_messageInfo_Claim.DiscardUnknown(m) } var xxx_messageInfo_Claim proto.InternalMessageInfo func (m *Claim) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *Claim) GetUID() string { if m != nil { return m.UID } return "" } func (m *Claim) GetName() string { if m != nil { return m.Name } return "" } func init() { proto.RegisterType((*NodePrepareResourcesRequest)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodePrepareResourcesRequest") proto.RegisterType((*NodePrepareResourcesResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodePrepareResourcesResponse") proto.RegisterMapType((map[string]*NodePrepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodePrepareResourcesResponse.ClaimsEntry") proto.RegisterType((*NodePrepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodePrepareResourceResponse") proto.RegisterType((*Device)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.Device") proto.RegisterType((*NodeUnprepareResourcesRequest)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodeUnprepareResourcesRequest") proto.RegisterType((*NodeUnprepareResourcesResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodeUnprepareResourcesResponse") proto.RegisterMapType((map[string]*NodeUnprepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodeUnprepareResourcesResponse.ClaimsEntry") proto.RegisterType((*NodeUnprepareResourceResponse)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.NodeUnprepareResourceResponse") proto.RegisterType((*Claim)(nil), "k8s.io.kubelet.pkg.apis.dra.v1beta1.Claim") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 591 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x6f, 0xd3, 0x40, 0x10, 0xcd, 0x26, 0x6d, 0x8a, 0x27, 0x01, 0x55, 0xab, 0x0a, 0x85, 0xb4, 0x38, 0x91, 0x7b, 0x89, 0x40, 0xd8, 0x6a, 0x10, 0xa8, 0xe2, 0xd4, 0x38, 0xe9, 0x21, 0x07, 0x4a, 0x65, 0x51, 0x84, 0xb8, 0x54, 0x8e, 0xbd, 0x18, 0x2b, 0x1f, 0x6b, 0xbc, 0x76, 0xa4, 0x82, 0x90, 0x10, 0x27, 0x8e, 0xfc, 0x01, 0x4e, 0xfd, 0x33, 0x3d, 0xc2, 0x8d, 0x53, 0x45, 0xcd, 0x1f, 0x41, 0xde, 0xdd, 0x84, 0x50, 0x39, 0x10, 0x35, 0x70, 0xdb, 0x79, 0x3b, 0x33, 0xef, 0x79, 0xf6, 0x79, 0x17, 0x14, 0x3b, 0xf0, 0xf5, 0x20, 0xa4, 0x11, 0xc5, 0xdb, 0xfd, 0x5d, 0xa6, 0xfb, 0x54, 0xef, 0xc7, 0x3d, 0x32, 0x20, 0x91, 0x1e, 0xf4, 0x3d, 0xdd, 0x0e, 0x7c, 0xa6, 0xbb, 0xa1, 0xad, 0x8f, 0x77, 0x7a, 0x24, 0xb2, 0x77, 0xaa, 0xf7, 0x3c, 0x3f, 0x7a, 0x15, 0xf7, 0x74, 0x87, 0x0e, 0x0d, 0x8f, 0x7a, 0xd4, 0xe0, 0xb5, 0xbd, 0xf8, 0x25, 0x8f, 0x78, 0xc0, 0x57, 0xa2, 0xa7, 0x66, 0xc3, 0xe6, 0x01, 0x75, 0xc9, 0x61, 0x48, 0x02, 0x3b, 0x24, 0x16, 0x61, 0x34, 0x0e, 0x1d, 0xc2, 0x2c, 0xf2, 0x3a, 0x26, 0x2c, 0xc2, 0x26, 0x14, 0x9d, 0x81, 0xed, 0x0f, 0x59, 0x05, 0xd5, 0x0b, 0x8d, 0x52, 0xf3, 0x8e, 0xbe, 0x80, 0x06, 0xbd, 0x9d, 0x96, 0x58, 0xb2, 0x52, 0xfb, 0x90, 0x87, 0xad, 0x6c, 0x0e, 0x16, 0xd0, 0x11, 0x23, 0x98, 0x5c, 0x22, 0x79, 0xbc, 0x10, 0xc9, 0x9f, 0x5a, 0x0a, 0x05, 0x6c, 0x7f, 0x14, 0x85, 0x27, 0x13, 0x1d, 0xd5, 0xb7, 0x50, 0x9a, 0x81, 0xf1, 0x3a, 0x14, 0xfa, 0xe4, 0xa4, 0x82, 0xea, 0xa8, 0xa1, 0x58, 0xe9, 0x12, 0x3f, 0x83, 0xd5, 0xb1, 0x3d, 0x88, 0x49, 0x25, 0x5f, 0x47, 0x8d, 0x52, 0x73, 0xef, 0xaa, 0x32, 0x26, 0x2a, 0x2c, 0xd1, 0xee, 0x51, 0x7e, 0x17, 0x69, 0x6f, 0x32, 0xe7, 0x3c, 0x1d, 0xc1, 0x3e, 0xac, 0xb9, 0x64, 0xec, 0x3b, 0x64, 0x32, 0x83, 0xbb, 0x0b, 0x91, 0x77, 0x78, 0x8d, 0x35, 0xa9, 0xc5, 0x1b, 0xb0, 0x4a, 0xc2, 0x90, 0x86, 0xfc, 0x0b, 0x14, 0x4b, 0x04, 0xda, 0x29, 0x82, 0xa2, 0xc8, 0xc4, 0xdb, 0x70, 0x3d, 0x14, 0x47, 0x7b, 0x3c, 0xb2, 0x87, 0x92, 0x4d, 0xb1, 0xca, 0x12, 0x3c, 0x48, 0x31, 0xbc, 0x09, 0x4a, 0x40, 0xe9, 0x80, 0x67, 0xc8, 0x4e, 0xd7, 0x52, 0x20, 0xdd, 0xc5, 0x35, 0x28, 0x09, 0x36, 0xb1, 0x5d, 0xe0, 0xdb, 0x20, 0x20, 0x9e, 0xf0, 0x10, 0x6e, 0x38, 0xae, 0x7f, 0x2c, 0x93, 0x7c, 0x97, 0x55, 0x56, 0x52, 0x0e, 0x73, 0x3d, 0x39, 0xaf, 0x95, 0xdb, 0x9d, 0xae, 0x50, 0xd2, 0xed, 0x30, 0xab, 0xec, 0xb8, 0xbe, 0x8c, 0x5c, 0xa6, 0x39, 0x70, 0x3b, 0x9d, 0xd0, 0xd1, 0x28, 0xf8, 0x8f, 0x5e, 0xfc, 0x98, 0x07, 0x75, 0x1e, 0x8b, 0x3c, 0x0a, 0xef, 0x12, 0xcd, 0x93, 0x85, 0x6d, 0x30, 0xbf, 0x69, 0xa6, 0x1f, 0xdf, 0xfd, 0xcd, 0x8f, 0xcf, 0x7f, 0xf7, 0xa3, 0x79, 0x75, 0x21, 0x59, 0x8e, 0x7c, 0x30, 0x67, 0xde, 0xd3, 0x41, 0x4c, 0xcd, 0x84, 0x66, 0xcd, 0xf4, 0x14, 0x56, 0xb9, 0x6a, 0xbc, 0x05, 0x0a, 0xb7, 0x50, 0x60, 0x3b, 0x44, 0xa6, 0xfc, 0x02, 0xf0, 0x2d, 0x28, 0xc4, 0xbe, 0x2b, 0xdc, 0x63, 0xae, 0x25, 0xe7, 0xb5, 0xc2, 0x51, 0xb7, 0x63, 0xa5, 0x18, 0xc6, 0xb0, 0x32, 0x63, 0x1d, 0xbe, 0x6e, 0x7e, 0xcd, 0x83, 0xd2, 0xb1, 0x5a, 0x87, 0x83, 0xd8, 0xf3, 0x47, 0xf8, 0x33, 0x82, 0x8d, 0xac, 0xdf, 0x1b, 0xef, 0x2d, 0x71, 0x33, 0x70, 0x13, 0x55, 0x5b, 0x4b, 0xdf, 0x2d, 0x5a, 0x0e, 0x9f, 0x22, 0xb8, 0x99, 0x7d, 0xe0, 0xd8, 0x5c, 0xca, 0x2d, 0x42, 0x63, 0xfb, 0x1f, 0x38, 0x4e, 0xcb, 0x99, 0xad, 0xb3, 0x0b, 0x15, 0x7d, 0xbb, 0x50, 0x73, 0xef, 0x13, 0x15, 0x9d, 0x25, 0x2a, 0xfa, 0x92, 0xa8, 0xe8, 0x7b, 0xa2, 0xa2, 0x4f, 0x3f, 0xd4, 0xdc, 0x0b, 0xf9, 0x98, 0x18, 0x92, 0xc3, 0x08, 0xfa, 0x9e, 0x91, 0x72, 0x18, 0x6e, 0x68, 0x1b, 0x92, 0xa3, 0x57, 0xe4, 0x8f, 0xc4, 0xfd, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xda, 0x25, 0x38, 0x7d, 0x85, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // 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 DRAPluginClient interface { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the // response is ignored. Failures for individual claims // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) } type dRAPluginClient struct { cc *grpc.ClientConn } func NewDRAPluginClient(cc *grpc.ClientConn) DRAPluginClient { return &dRAPluginClient{cc} } func (c *dRAPluginClient) NodePrepareResources(ctx context.Context, in *NodePrepareResourcesRequest, opts ...grpc.CallOption) (*NodePrepareResourcesResponse, error) { out := new(NodePrepareResourcesResponse) err := c.cc.Invoke(ctx, "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodePrepareResources", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *dRAPluginClient) NodeUnprepareResources(ctx context.Context, in *NodeUnprepareResourcesRequest, opts ...grpc.CallOption) (*NodeUnprepareResourcesResponse, error) { out := new(NodeUnprepareResourcesResponse) err := c.cc.Invoke(ctx, "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodeUnprepareResources", in, out, opts...) if err != nil { return nil, err } return out, nil } // 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 // can be reported inside NodePrepareResourcesResponse. NodePrepareResources(context.Context, *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, NodeUnprepareResources(context.Context, *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) } // UnimplementedDRAPluginServer can be embedded to have forward compatible implementations. type UnimplementedDRAPluginServer struct { } func (*UnimplementedDRAPluginServer) NodePrepareResources(ctx context.Context, req *NodePrepareResourcesRequest) (*NodePrepareResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodePrepareResources not implemented") } func (*UnimplementedDRAPluginServer) NodeUnprepareResources(ctx context.Context, req *NodeUnprepareResourcesRequest) (*NodeUnprepareResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NodeUnprepareResources not implemented") } func RegisterDRAPluginServer(s *grpc.Server, srv DRAPluginServer) { s.RegisterService(&_DRAPlugin_serviceDesc, srv) } 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.(DRAPluginServer).NodePrepareResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodePrepareResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DRAPluginServer).NodePrepareResources(ctx, req.(*NodePrepareResourcesRequest)) } return interceptor(ctx, in, info, handler) } 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.(DRAPluginServer).NodeUnprepareResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: "/k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin/NodeUnprepareResources", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DRAPluginServer).NodeUnprepareResources(ctx, req.(*NodeUnprepareResourcesRequest)) } return interceptor(ctx, in, info, handler) } var _DRAPlugin_serviceDesc = grpc.ServiceDesc{ ServiceName: "k8s.io.kubelet.pkg.apis.dra.v1beta1.DRAPlugin", HandlerType: (*DRAPluginServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "NodePrepareResources", Handler: _DRAPlugin_NodePrepareResources_Handler, }, { MethodName: "NodeUnprepareResources", Handler: _DRAPlugin_NodeUnprepareResources_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } func (m *NodePrepareResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodePrepareResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for k := range m.Claims { v := m.Claims[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodePrepareResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodePrepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodePrepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *Device) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Device) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Device) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.CDIDeviceIDs) > 0 { for iNdEx := len(m.CDIDeviceIDs) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.CDIDeviceIDs[iNdEx]) copy(dAtA[i:], m.CDIDeviceIDs[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.CDIDeviceIDs[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.DeviceName) > 0 { i -= len(m.DeviceName) copy(dAtA[i:], m.DeviceName) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) i-- dAtA[i] = 0x1a } if len(m.PoolName) > 0 { i -= len(m.PoolName) copy(dAtA[i:], m.PoolName) i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) i-- dAtA[i] = 0x12 } if len(m.RequestNames) > 0 { for iNdEx := len(m.RequestNames) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.RequestNames[iNdEx]) copy(dAtA[i:], m.RequestNames[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.RequestNames[iNdEx]))) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for iNdEx := len(m.Claims) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Claims[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Claims) > 0 { for k := range m.Claims { v := m.Claims[k] baseI := i if v != nil { { size, err := v.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintApi(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintApi(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NodeUnprepareResourceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NodeUnprepareResourceResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NodeUnprepareResourceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *Claim) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *Claim) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Claim) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x1a } if len(m.UID) > 0 { i -= len(m.UID) copy(dAtA[i:], m.UID) i = encodeVarintApi(dAtA, i, uint64(len(m.UID))) i-- dAtA[i] = 0x12 } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *NodePrepareResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for _, e := range m.Claims { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodePrepareResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for k, v := range m.Claims { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovApi(uint64(l)) } mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *NodePrepareResourceResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Device) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.RequestNames) > 0 { for _, s := range m.RequestNames { l = len(s) n += 1 + l + sovApi(uint64(l)) } } l = len(m.PoolName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.DeviceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.CDIDeviceIDs) > 0 { for _, s := range m.CDIDeviceIDs { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodeUnprepareResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for _, e := range m.Claims { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NodeUnprepareResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Claims) > 0 { for k, v := range m.Claims { _ = k _ = v l = 0 if v != nil { l = v.Size() l += 1 + sovApi(uint64(l)) } mapEntrySize := 1 + len(k) + sovApi(uint64(len(k))) + l n += mapEntrySize + 1 + sovApi(uint64(mapEntrySize)) } } return n } func (m *NodeUnprepareResourceResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *Claim) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.UID) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *NodePrepareResourcesRequest) String() string { if this == nil { return "nil" } repeatedStringForClaims := "[]*Claim{" for _, f := range this.Claims { repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," } repeatedStringForClaims += "}" s := strings.Join([]string{`&NodePrepareResourcesRequest{`, `Claims:` + repeatedStringForClaims + `,`, `}`, }, "") return s } func (this *NodePrepareResourcesResponse) String() string { if this == nil { return "nil" } keysForClaims := make([]string, 0, len(this.Claims)) for k := range this.Claims { keysForClaims = append(keysForClaims, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) mapStringForClaims := "map[string]*NodePrepareResourceResponse{" for _, k := range keysForClaims { mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) } mapStringForClaims += "}" s := strings.Join([]string{`&NodePrepareResourcesResponse{`, `Claims:` + mapStringForClaims + `,`, `}`, }, "") return s } func (this *NodePrepareResourceResponse) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*Device{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "Device", "Device", 1) + "," } repeatedStringForDevices += "}" s := strings.Join([]string{`&NodePrepareResourceResponse{`, `Devices:` + repeatedStringForDevices + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *Device) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Device{`, `RequestNames:` + fmt.Sprintf("%v", this.RequestNames) + `,`, `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, `CDIDeviceIDs:` + fmt.Sprintf("%v", this.CDIDeviceIDs) + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourcesRequest) String() string { if this == nil { return "nil" } repeatedStringForClaims := "[]*Claim{" for _, f := range this.Claims { repeatedStringForClaims += strings.Replace(f.String(), "Claim", "Claim", 1) + "," } repeatedStringForClaims += "}" s := strings.Join([]string{`&NodeUnprepareResourcesRequest{`, `Claims:` + repeatedStringForClaims + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourcesResponse) String() string { if this == nil { return "nil" } keysForClaims := make([]string, 0, len(this.Claims)) for k := range this.Claims { keysForClaims = append(keysForClaims, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForClaims) mapStringForClaims := "map[string]*NodeUnprepareResourceResponse{" for _, k := range keysForClaims { mapStringForClaims += fmt.Sprintf("%v: %v,", k, this.Claims[k]) } mapStringForClaims += "}" s := strings.Join([]string{`&NodeUnprepareResourcesResponse{`, `Claims:` + mapStringForClaims + `,`, `}`, }, "") return s } func (this *NodeUnprepareResourceResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NodeUnprepareResourceResponse{`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *Claim) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Claim{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *NodePrepareResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Claims = append(m.Claims, &Claim{}) if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodePrepareResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Claims == nil { m.Claims = make(map[string]*NodePrepareResourceResponse) } var mapkey string var mapvalue *NodePrepareResourceResponse for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthApi } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthApi } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &NodePrepareResourceResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Claims[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodePrepareResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodePrepareResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodePrepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &Device{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Device) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Device: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Device: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RequestNames", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.RequestNames = append(m.RequestNames, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PoolName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CDIDeviceIDs", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CDIDeviceIDs = append(m.CDIDeviceIDs, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Claims = append(m.Claims, &Claim{}) if err := m.Claims[len(m.Claims)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Claims", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Claims == nil { m.Claims = make(map[string]*NodeUnprepareResourceResponse) } var mapkey string var mapvalue *NodeUnprepareResourceResponse for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthApi } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthApi } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= int(b&0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthApi } postmsgIndex := iNdEx + mapmsglen if postmsgIndex < 0 { return ErrInvalidLengthApi } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue = &NodeUnprepareResourceResponse{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex } else { iNdEx = entryPreIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Claims[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NodeUnprepareResourceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NodeUnprepareResourceResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NodeUnprepareResourceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Claim) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: Claim: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Claim: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.UID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/dra/v1beta1/api.proto000066400000000000000000000077411503561374700230140ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package k8s.io.kubelet.pkg.apis.dra.v1beta1; option go_package = "k8s.io/kubelet/pkg/apis/dra/v1beta1"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; service DRAPlugin { // NodePrepareResources prepares several ResourceClaims // for use on the node. If an error is returned, the // response is ignored. Failures for individual claims // can be reported inside NodePrepareResourcesResponse. rpc NodePrepareResources (NodePrepareResourcesRequest) returns (NodePrepareResourcesResponse) {} // NodeUnprepareResources is the opposite of NodePrepareResources. // The same error handling rules apply, rpc NodeUnprepareResources (NodeUnprepareResourcesRequest) returns (NodeUnprepareResourcesResponse) {} } message NodePrepareResourcesRequest { // The list of ResourceClaims that are to be prepared. repeated Claim claims = 1; } message NodePrepareResourcesResponse { // The ResourceClaims for which preparation was done // or attempted, with claim_uid as key. // // It is an error if some claim listed in NodePrepareResourcesRequest // does not get prepared. NodePrepareResources // will be called again for those that are missing. map claims = 1; } message NodePrepareResourceResponse { // These are the additional devices that kubelet must // make available via the container runtime. A claim // may have zero or more requests and each request // may have zero or more devices. repeated Device devices = 1; // If non-empty, preparing the ResourceClaim failed. // Devices are ignored in that case. string error = 2; } message Device { // The requests in the claim that this device is associated with. // Optional. If empty, the device is associated with all requests. repeated string request_names = 1; // The pool which contains the device. Required. string pool_name = 2; // The device itself. Required. string device_name = 3; // A single device instance may map to several CDI device IDs. // None is also valid. repeated string cdi_device_ids = 4 [(gogoproto.customname) = "CDIDeviceIDs"]; } message NodeUnprepareResourcesRequest { // The list of ResourceClaims that are to be unprepared. repeated Claim claims = 1; } message NodeUnprepareResourcesResponse { // The ResourceClaims for which preparation was reverted. // The same rules as for NodePrepareResourcesResponse.claims // apply. map claims = 1; } message NodeUnprepareResourceResponse { // If non-empty, unpreparing the ResourceClaim failed. string error = 1; } message Claim { // The ResourceClaim namespace (ResourceClaim.meta.Namespace). // This field is REQUIRED. string namespace = 1; // The UID of the Resource claim (ResourceClaim.meta.UUID). // This field is REQUIRED. string uid = 2 [(gogoproto.customname) = "UID"]; // The name of the Resource claim (ResourceClaim.meta.Name) // This field is REQUIRED. string name = 3; } kubelet-kubernetes-1.32.7/pkg/apis/dra/v1beta1/types.go000066400000000000000000000014761503561374700226500ustar00rootroot00000000000000/* Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 const ( // DRAPluginService needs to be listed in the "supported versions" // array during plugin registration by a DRA plugin which provides // an implementation of the v1beta1 DRAPlugin service. DRAPluginService = "v1beta1.DRAPlugin" ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/000077500000000000000000000000001503561374700230655ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1/000077500000000000000000000000001503561374700234135ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1/api.pb.go000066400000000000000000000742561503561374700251310ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration type PluginInfo struct { // Type of the Plugin. CSIPlugin or DevicePlugin Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. SupportedVersions []string `protobuf:"bytes,4,rep,name=supported_versions,json=supportedVersions,proto3" json:"supported_versions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PluginInfo) Reset() { *m = PluginInfo{} } func (*PluginInfo) ProtoMessage() {} func (*PluginInfo) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *PluginInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PluginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PluginInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PluginInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PluginInfo.Merge(m, src) } func (m *PluginInfo) XXX_Size() int { return m.Size() } func (m *PluginInfo) XXX_DiscardUnknown() { xxx_messageInfo_PluginInfo.DiscardUnknown(m) } var xxx_messageInfo_PluginInfo proto.InternalMessageInfo func (m *PluginInfo) GetType() string { if m != nil { return m.Type } return "" } func (m *PluginInfo) GetName() string { if m != nil { return m.Name } return "" } func (m *PluginInfo) GetEndpoint() string { if m != nil { return m.Endpoint } return "" } func (m *PluginInfo) GetSupportedVersions() []string { if m != nil { return m.SupportedVersions } return nil } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status type RegistrationStatus struct { // True if plugin gets registered successfully at Kubelet PluginRegistered bool `protobuf:"varint,1,opt,name=plugin_registered,json=pluginRegistered,proto3" json:"plugin_registered,omitempty"` // Error message in case plugin fails to register, empty string otherwise Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatus) Reset() { *m = RegistrationStatus{} } func (*RegistrationStatus) ProtoMessage() {} func (*RegistrationStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *RegistrationStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatus.Merge(m, src) } func (m *RegistrationStatus) XXX_Size() int { return m.Size() } func (m *RegistrationStatus) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatus.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatus proto.InternalMessageInfo func (m *RegistrationStatus) GetPluginRegistered() bool { if m != nil { return m.PluginRegistered } return false } func (m *RegistrationStatus) GetError() string { if m != nil { return m.Error } return "" } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC type RegistrationStatusResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatusResponse) Reset() { *m = RegistrationStatusResponse{} } func (*RegistrationStatusResponse) ProtoMessage() {} func (*RegistrationStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *RegistrationStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatusResponse.Merge(m, src) } func (m *RegistrationStatusResponse) XXX_Size() int { return m.Size() } func (m *RegistrationStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatusResponse proto.InternalMessageInfo // InfoRequest is the empty request message from Kubelet type InfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *InfoRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_InfoRequest.Merge(m, src) } func (m *InfoRequest) XXX_Size() int { return m.Size() } func (m *InfoRequest) XXX_DiscardUnknown() { xxx_messageInfo_InfoRequest.DiscardUnknown(m) } var xxx_messageInfo_InfoRequest proto.InternalMessageInfo func init() { proto.RegisterType((*PluginInfo)(nil), "pluginregistration.PluginInfo") proto.RegisterType((*RegistrationStatus)(nil), "pluginregistration.RegistrationStatus") proto.RegisterType((*RegistrationStatusResponse)(nil), "pluginregistration.RegistrationStatusResponse") proto.RegisterType((*InfoRequest)(nil), "pluginregistration.InfoRequest") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 365 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0x4a, 0xeb, 0x40, 0x14, 0xcd, 0xbc, 0xf6, 0xbd, 0xd7, 0x8e, 0x0a, 0x76, 0x70, 0x11, 0x82, 0x8c, 0x25, 0x0b, 0x29, 0x48, 0x13, 0xd4, 0x8d, 0x6b, 0x37, 0x22, 0x8a, 0x48, 0x04, 0x05, 0x37, 0x25, 0xb1, 0xb7, 0x71, 0x68, 0x3b, 0x33, 0xce, 0x4c, 0x0a, 0x5d, 0xe9, 0x27, 0xf8, 0x59, 0x5d, 0x8a, 0x2b, 0x97, 0x36, 0xfe, 0x88, 0x74, 0x52, 0x62, 0x21, 0x5d, 0xb8, 0xbb, 0xe7, 0xdc, 0x73, 0xef, 0xdc, 0x73, 0x18, 0xdc, 0x8c, 0x25, 0x0b, 0xa4, 0x12, 0x46, 0x10, 0x22, 0x47, 0x59, 0xca, 0xb8, 0x82, 0x94, 0x69, 0xa3, 0x62, 0xc3, 0x04, 0xf7, 0xba, 0x29, 0x33, 0x8f, 0x59, 0x12, 0x3c, 0x88, 0x71, 0x98, 0x8a, 0x54, 0x84, 0x56, 0x9a, 0x64, 0x03, 0x8b, 0x2c, 0xb0, 0x55, 0xb1, 0xc2, 0x7f, 0xc6, 0xf8, 0xda, 0x2e, 0x39, 0xe7, 0x03, 0x41, 0x08, 0xae, 0x9b, 0xa9, 0x04, 0x17, 0xb5, 0x51, 0xa7, 0x19, 0xd9, 0x7a, 0xc1, 0xf1, 0x78, 0x0c, 0xee, 0x9f, 0x82, 0x5b, 0xd4, 0xc4, 0xc3, 0x0d, 0xe0, 0x7d, 0x29, 0x18, 0x37, 0x6e, 0xcd, 0xf2, 0x25, 0x26, 0x5d, 0x4c, 0x74, 0x26, 0xa5, 0x50, 0x06, 0xfa, 0xbd, 0x09, 0x28, 0xcd, 0x04, 0xd7, 0x6e, 0xbd, 0x5d, 0xeb, 0x34, 0xa3, 0x56, 0xd9, 0xb9, 0x5d, 0x36, 0xfc, 0x3b, 0x4c, 0xa2, 0x95, 0xfb, 0x6f, 0x4c, 0x6c, 0x32, 0x4d, 0x0e, 0x70, 0xab, 0xf0, 0xd6, 0x2b, 0xcc, 0x81, 0x82, 0xbe, 0xbd, 0xaa, 0x11, 0x6d, 0x17, 0x8d, 0xa8, 0xe4, 0xc9, 0x0e, 0xfe, 0x0b, 0x4a, 0x09, 0xb5, 0x3c, 0xb1, 0x00, 0xfe, 0x2e, 0xf6, 0xaa, 0x8b, 0x23, 0xd0, 0x52, 0x70, 0x0d, 0xfe, 0x16, 0xde, 0x58, 0x38, 0x8e, 0xe0, 0x29, 0x03, 0x6d, 0x8e, 0xde, 0x11, 0xde, 0x5c, 0x55, 0x93, 0x4b, 0xfc, 0xff, 0x0c, 0x8c, 0x0d, 0x65, 0x2f, 0xa8, 0xc6, 0x1c, 0xac, 0x0c, 0x7b, 0x74, 0x9d, 0xe0, 0x27, 0x55, 0xdf, 0x21, 0x06, 0xbb, 0x57, 0xc2, 0xb0, 0xc1, 0x74, 0x8d, 0xd5, 0xfd, 0x75, 0xd3, 0x55, 0x9d, 0x17, 0xfc, 0x4e, 0x57, 0x3a, 0x74, 0x4e, 0x2f, 0x66, 0x73, 0x8a, 0x3e, 0xe6, 0xd4, 0x79, 0xc9, 0x29, 0x9a, 0xe5, 0x14, 0xbd, 0xe5, 0x14, 0x7d, 0xe6, 0x14, 0xbd, 0x7e, 0x51, 0xe7, 0xbe, 0x3b, 0x3c, 0xd1, 0x01, 0x13, 0xe1, 0x30, 0x4b, 0x60, 0x04, 0x26, 0x94, 0xc3, 0x34, 0x8c, 0x25, 0xd3, 0x61, 0xf5, 0x99, 0x70, 0x72, 0x98, 0xfc, 0xb3, 0xff, 0xe5, 0xf8, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x5f, 0xd4, 0xb2, 0x7f, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RegistrationClient is the client API for Registration service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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.ClientConn } func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient { return ®istrationClient{cc} } func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) { out := new(PluginInfo) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/GetInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) { out := new(RegistrationStatusResponse) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/NotifyRegistrationStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } // RegistrationServer is the server API for Registration service. type RegistrationServer interface { GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) } // UnimplementedRegistrationServer can be embedded to have forward compatible implementations. type UnimplementedRegistrationServer struct { } func (*UnimplementedRegistrationServer) GetInfo(ctx context.Context, req *InfoRequest) (*PluginInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } func (*UnimplementedRegistrationServer) NotifyRegistrationStatus(ctx context.Context, req *RegistrationStatus) (*RegistrationStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented") } func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) { 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: "/pluginregistration.Registration/GetInfo", } 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: "/pluginregistration.Registration/NotifyRegistrationStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *PluginInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PluginInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PluginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.SupportedVersions) > 0 { for iNdEx := len(m.SupportedVersions) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SupportedVersions[iNdEx]) copy(dAtA[i:], m.SupportedVersions[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.SupportedVersions[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.Endpoint) > 0 { i -= len(m.Endpoint) copy(dAtA[i:], m.Endpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RegistrationStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if m.PluginRegistered { i-- if m.PluginRegistered { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *RegistrationStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *PluginInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Endpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.SupportedVersions) > 0 { for _, s := range m.SupportedVersions { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *RegistrationStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.PluginRegistered { n += 2 } l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RegistrationStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *InfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *PluginInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PluginInfo{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, `SupportedVersions:` + fmt.Sprintf("%v", this.SupportedVersions) + `,`, `}`, }, "") return s } func (this *RegistrationStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatus{`, `PluginRegistered:` + fmt.Sprintf("%v", this.PluginRegistered) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *RegistrationStatusResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatusResponse{`, `}`, }, "") return s } func (this *InfoRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&InfoRequest{`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *PluginInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PluginInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PluginInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SupportedVersions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.SupportedVersions = append(m.SupportedVersions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PluginRegistered", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.PluginRegistered = bool(v != 0) case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *InfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1/api.proto000066400000000000000000000050441503561374700252540ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package pluginregistration; // This should have been v1. option go_package = "k8s.io/kubelet/pkg/apis/pluginregistration/v1"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; // PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration message PluginInfo { // Type of the Plugin. CSIPlugin or DevicePlugin string type = 1; // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. string name = 2; // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. string endpoint = 3; // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. repeated string supported_versions = 4; } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status message RegistrationStatus { // True if plugin gets registered successfully at Kubelet bool plugin_registered = 1; // Error message in case plugin fails to register, empty string otherwise string error = 2; } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC message RegistrationStatusResponse { } // InfoRequest is the empty request message from Kubelet message InfoRequest { } // Registration is the service advertised by the Plugins. service Registration { rpc GetInfo(InfoRequest) returns (PluginInfo) {} rpc NotifyRegistrationStatus(RegistrationStatus) returns (RegistrationStatusResponse) {} } kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1/constants.go000066400000000000000000000015331503561374700257600ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1 const ( // CSIPlugin identifier for registered CSI plugins CSIPlugin = "CSIPlugin" // DevicePlugin identifier for registered device plugins DevicePlugin = "DevicePlugin" // DRAPlugin identifier for registered Dynamic Resourc Allocation plugins DRAPlugin = "DRAPlugin" ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1alpha1/000077500000000000000000000000001503561374700245025ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1alpha1/api.pb.go000066400000000000000000000743451503561374700262170ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1alpha1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration type PluginInfo struct { // Type of the Plugin. CSIPlugin or DevicePlugin Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. SupportedVersions []string `protobuf:"bytes,4,rep,name=supported_versions,json=supportedVersions,proto3" json:"supported_versions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PluginInfo) Reset() { *m = PluginInfo{} } func (*PluginInfo) ProtoMessage() {} func (*PluginInfo) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *PluginInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PluginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PluginInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PluginInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PluginInfo.Merge(m, src) } func (m *PluginInfo) XXX_Size() int { return m.Size() } func (m *PluginInfo) XXX_DiscardUnknown() { xxx_messageInfo_PluginInfo.DiscardUnknown(m) } var xxx_messageInfo_PluginInfo proto.InternalMessageInfo func (m *PluginInfo) GetType() string { if m != nil { return m.Type } return "" } func (m *PluginInfo) GetName() string { if m != nil { return m.Name } return "" } func (m *PluginInfo) GetEndpoint() string { if m != nil { return m.Endpoint } return "" } func (m *PluginInfo) GetSupportedVersions() []string { if m != nil { return m.SupportedVersions } return nil } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status type RegistrationStatus struct { // True if plugin gets registered successfully at Kubelet PluginRegistered bool `protobuf:"varint,1,opt,name=plugin_registered,json=pluginRegistered,proto3" json:"plugin_registered,omitempty"` // Error message in case plugin fails to register, empty string otherwise Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatus) Reset() { *m = RegistrationStatus{} } func (*RegistrationStatus) ProtoMessage() {} func (*RegistrationStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *RegistrationStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatus.Merge(m, src) } func (m *RegistrationStatus) XXX_Size() int { return m.Size() } func (m *RegistrationStatus) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatus.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatus proto.InternalMessageInfo func (m *RegistrationStatus) GetPluginRegistered() bool { if m != nil { return m.PluginRegistered } return false } func (m *RegistrationStatus) GetError() string { if m != nil { return m.Error } return "" } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC type RegistrationStatusResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatusResponse) Reset() { *m = RegistrationStatusResponse{} } func (*RegistrationStatusResponse) ProtoMessage() {} func (*RegistrationStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *RegistrationStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatusResponse.Merge(m, src) } func (m *RegistrationStatusResponse) XXX_Size() int { return m.Size() } func (m *RegistrationStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatusResponse proto.InternalMessageInfo // InfoRequest is the empty request message from Kubelet type InfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *InfoRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_InfoRequest.Merge(m, src) } func (m *InfoRequest) XXX_Size() int { return m.Size() } func (m *InfoRequest) XXX_DiscardUnknown() { xxx_messageInfo_InfoRequest.DiscardUnknown(m) } var xxx_messageInfo_InfoRequest proto.InternalMessageInfo func init() { proto.RegisterType((*PluginInfo)(nil), "pluginregistration.PluginInfo") proto.RegisterType((*RegistrationStatus)(nil), "pluginregistration.RegistrationStatus") proto.RegisterType((*RegistrationStatusResponse)(nil), "pluginregistration.RegistrationStatusResponse") proto.RegisterType((*InfoRequest)(nil), "pluginregistration.InfoRequest") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 373 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x4b, 0xe3, 0x40, 0x14, 0xce, 0x6c, 0xbb, 0xbb, 0xed, 0xec, 0x2e, 0x6c, 0x87, 0x3d, 0x84, 0xb0, 0x8c, 0x25, 0x07, 0x29, 0x48, 0x13, 0x6a, 0x2f, 0x9e, 0xbd, 0x88, 0x20, 0xa2, 0x11, 0x14, 0xbc, 0x94, 0xc4, 0xbe, 0xa6, 0x43, 0xdb, 0x99, 0x71, 0x66, 0x52, 0xe8, 0x49, 0x7f, 0x82, 0x3f, 0xab, 0x47, 0xf1, 0xe4, 0xd1, 0xc6, 0x3f, 0x22, 0x9d, 0x94, 0x58, 0x48, 0x0f, 0xde, 0xde, 0xf7, 0xbd, 0xef, 0xbd, 0x79, 0xdf, 0xc7, 0xe0, 0x66, 0x2c, 0x59, 0x20, 0x95, 0x30, 0x82, 0x10, 0x39, 0xcd, 0x52, 0xc6, 0x15, 0xa4, 0x4c, 0x1b, 0x15, 0x1b, 0x26, 0xb8, 0xd7, 0x4d, 0x99, 0x19, 0x67, 0x49, 0x70, 0x27, 0x66, 0x61, 0x2a, 0x52, 0x11, 0x5a, 0x69, 0x92, 0x8d, 0x2c, 0xb2, 0xc0, 0x56, 0xc5, 0x0a, 0xff, 0x01, 0xe3, 0x0b, 0xbb, 0xe4, 0x94, 0x8f, 0x04, 0x21, 0xb8, 0x6e, 0x16, 0x12, 0x5c, 0xd4, 0x46, 0x9d, 0x66, 0x64, 0xeb, 0x35, 0xc7, 0xe3, 0x19, 0xb8, 0xdf, 0x0a, 0x6e, 0x5d, 0x13, 0x0f, 0x37, 0x80, 0x0f, 0xa5, 0x60, 0xdc, 0xb8, 0x35, 0xcb, 0x97, 0x98, 0x74, 0x31, 0xd1, 0x99, 0x94, 0x42, 0x19, 0x18, 0x0e, 0xe6, 0xa0, 0x34, 0x13, 0x5c, 0xbb, 0xf5, 0x76, 0xad, 0xd3, 0x8c, 0x5a, 0x65, 0xe7, 0x7a, 0xd3, 0xf0, 0x6f, 0x30, 0x89, 0xb6, 0xee, 0xbf, 0x32, 0xb1, 0xc9, 0x34, 0x39, 0xc0, 0xad, 0xc2, 0xdb, 0xa0, 0x30, 0x07, 0x0a, 0x86, 0xf6, 0xaa, 0x46, 0xf4, 0xb7, 0x68, 0x44, 0x25, 0x4f, 0xfe, 0xe1, 0xef, 0xa0, 0x94, 0x50, 0x9b, 0x13, 0x0b, 0xe0, 0xff, 0xc7, 0x5e, 0x75, 0x71, 0x04, 0x5a, 0x0a, 0xae, 0xc1, 0xff, 0x83, 0x7f, 0xad, 0x1d, 0x47, 0x70, 0x9f, 0x81, 0x36, 0x87, 0x2f, 0x08, 0xff, 0xde, 0x56, 0x93, 0x33, 0xfc, 0xf3, 0x04, 0x8c, 0x0d, 0x65, 0x2f, 0xa8, 0xc6, 0x1c, 0x6c, 0x0d, 0x7b, 0x74, 0x97, 0xe0, 0x33, 0x55, 0xdf, 0x21, 0x06, 0xbb, 0xe7, 0xc2, 0xb0, 0xd1, 0x62, 0x87, 0xd5, 0xfd, 0x5d, 0xd3, 0x55, 0x9d, 0x17, 0x7c, 0x4d, 0x57, 0x3a, 0x74, 0x8e, 0x2f, 0x97, 0x2b, 0x8a, 0x5e, 0x57, 0xd4, 0x79, 0xcc, 0x29, 0x5a, 0xe6, 0x14, 0x3d, 0xe7, 0x14, 0xbd, 0xe5, 0x14, 0x3d, 0xbd, 0x53, 0xe7, 0xb6, 0x3f, 0x39, 0xd2, 0x01, 0x13, 0xe1, 0x24, 0x4b, 0x60, 0x0a, 0x26, 0x94, 0x93, 0x34, 0x8c, 0x25, 0xd3, 0x61, 0xf5, 0x99, 0x70, 0xde, 0x8b, 0xa7, 0x72, 0x1c, 0xf7, 0x92, 0x1f, 0xf6, 0xd7, 0xf4, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x60, 0x59, 0x70, 0xa3, 0x85, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RegistrationClient is the client API for Registration service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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.ClientConn } func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient { return ®istrationClient{cc} } func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) { out := new(PluginInfo) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/GetInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) { out := new(RegistrationStatusResponse) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/NotifyRegistrationStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } // RegistrationServer is the server API for Registration service. type RegistrationServer interface { GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) } // UnimplementedRegistrationServer can be embedded to have forward compatible implementations. type UnimplementedRegistrationServer struct { } func (*UnimplementedRegistrationServer) GetInfo(ctx context.Context, req *InfoRequest) (*PluginInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } func (*UnimplementedRegistrationServer) NotifyRegistrationStatus(ctx context.Context, req *RegistrationStatus) (*RegistrationStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented") } func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) { 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: "/pluginregistration.Registration/GetInfo", } 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: "/pluginregistration.Registration/NotifyRegistrationStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *PluginInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PluginInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PluginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.SupportedVersions) > 0 { for iNdEx := len(m.SupportedVersions) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SupportedVersions[iNdEx]) copy(dAtA[i:], m.SupportedVersions[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.SupportedVersions[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.Endpoint) > 0 { i -= len(m.Endpoint) copy(dAtA[i:], m.Endpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RegistrationStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if m.PluginRegistered { i-- if m.PluginRegistered { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *RegistrationStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *PluginInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Endpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.SupportedVersions) > 0 { for _, s := range m.SupportedVersions { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *RegistrationStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.PluginRegistered { n += 2 } l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RegistrationStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *InfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *PluginInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PluginInfo{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, `SupportedVersions:` + fmt.Sprintf("%v", this.SupportedVersions) + `,`, `}`, }, "") return s } func (this *RegistrationStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatus{`, `PluginRegistered:` + fmt.Sprintf("%v", this.PluginRegistered) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *RegistrationStatusResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatusResponse{`, `}`, }, "") return s } func (this *InfoRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&InfoRequest{`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *PluginInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PluginInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PluginInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SupportedVersions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.SupportedVersions = append(m.SupportedVersions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PluginRegistered", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.PluginRegistered = bool(v != 0) case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *InfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1alpha1/api.proto000066400000000000000000000050601503561374700263410ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` 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 string type = 1; // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. string name = 2; // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. string endpoint = 3; // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. repeated string supported_versions = 4; } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status message RegistrationStatus { // True if plugin gets registered successfully at Kubelet bool plugin_registered = 1; // Error message in case plugin fails to register, empty string otherwise string error = 2; } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC message RegistrationStatusResponse { } // InfoRequest is the empty request message from Kubelet message InfoRequest { } // Registration is the service advertised by the Plugins. service Registration { rpc GetInfo(InfoRequest) returns (PluginInfo) {} rpc NotifyRegistrationStatus(RegistrationStatus) returns (RegistrationStatusResponse) {} } kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1alpha1/constants.go000066400000000000000000000013751503561374700270530ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha1 const ( // CSIPlugin identifier for registered CSI plugins CSIPlugin = "CSIPlugin" // DevicePlugin identifier for registered device plugins DevicePlugin = "DevicePlugin" ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1beta1/000077500000000000000000000000001503561374700243305ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1beta1/api.pb.go000066400000000000000000000743301503561374700260370ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1beta1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PluginInfo is the message sent from a plugin to the Kubelet pluginwatcher for plugin registration type PluginInfo struct { // Type of the Plugin. CSIPlugin or DevicePlugin Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. SupportedVersions []string `protobuf:"bytes,4,rep,name=supported_versions,json=supportedVersions,proto3" json:"supported_versions,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PluginInfo) Reset() { *m = PluginInfo{} } func (*PluginInfo) ProtoMessage() {} func (*PluginInfo) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *PluginInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PluginInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PluginInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PluginInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PluginInfo.Merge(m, src) } func (m *PluginInfo) XXX_Size() int { return m.Size() } func (m *PluginInfo) XXX_DiscardUnknown() { xxx_messageInfo_PluginInfo.DiscardUnknown(m) } var xxx_messageInfo_PluginInfo proto.InternalMessageInfo func (m *PluginInfo) GetType() string { if m != nil { return m.Type } return "" } func (m *PluginInfo) GetName() string { if m != nil { return m.Name } return "" } func (m *PluginInfo) GetEndpoint() string { if m != nil { return m.Endpoint } return "" } func (m *PluginInfo) GetSupportedVersions() []string { if m != nil { return m.SupportedVersions } return nil } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status type RegistrationStatus struct { // True if plugin gets registered successfully at Kubelet PluginRegistered bool `protobuf:"varint,1,opt,name=plugin_registered,json=pluginRegistered,proto3" json:"plugin_registered,omitempty"` // Error message in case plugin fails to register, empty string otherwise Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatus) Reset() { *m = RegistrationStatus{} } func (*RegistrationStatus) ProtoMessage() {} func (*RegistrationStatus) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *RegistrationStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatus.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatus.Merge(m, src) } func (m *RegistrationStatus) XXX_Size() int { return m.Size() } func (m *RegistrationStatus) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatus.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatus proto.InternalMessageInfo func (m *RegistrationStatus) GetPluginRegistered() bool { if m != nil { return m.PluginRegistered } return false } func (m *RegistrationStatus) GetError() string { if m != nil { return m.Error } return "" } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC type RegistrationStatusResponse struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *RegistrationStatusResponse) Reset() { *m = RegistrationStatusResponse{} } func (*RegistrationStatusResponse) ProtoMessage() {} func (*RegistrationStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *RegistrationStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *RegistrationStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_RegistrationStatusResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *RegistrationStatusResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_RegistrationStatusResponse.Merge(m, src) } func (m *RegistrationStatusResponse) XXX_Size() int { return m.Size() } func (m *RegistrationStatusResponse) XXX_DiscardUnknown() { xxx_messageInfo_RegistrationStatusResponse.DiscardUnknown(m) } var xxx_messageInfo_RegistrationStatusResponse proto.InternalMessageInfo // InfoRequest is the empty request message from Kubelet type InfoRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *InfoRequest) Reset() { *m = InfoRequest{} } func (*InfoRequest) ProtoMessage() {} func (*InfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *InfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *InfoRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_InfoRequest.Merge(m, src) } func (m *InfoRequest) XXX_Size() int { return m.Size() } func (m *InfoRequest) XXX_DiscardUnknown() { xxx_messageInfo_InfoRequest.DiscardUnknown(m) } var xxx_messageInfo_InfoRequest proto.InternalMessageInfo func init() { proto.RegisterType((*PluginInfo)(nil), "pluginregistration.PluginInfo") proto.RegisterType((*RegistrationStatus)(nil), "pluginregistration.RegistrationStatus") proto.RegisterType((*RegistrationStatusResponse)(nil), "pluginregistration.RegistrationStatusResponse") proto.RegisterType((*InfoRequest)(nil), "pluginregistration.InfoRequest") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 371 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0x41, 0x4b, 0xe3, 0x40, 0x14, 0xce, 0x6c, 0xbb, 0xbb, 0xed, 0xec, 0x2e, 0x6c, 0x07, 0x0f, 0x21, 0xc8, 0x58, 0x72, 0x90, 0x82, 0x34, 0xa1, 0xf5, 0xe2, 0xd9, 0x8b, 0x08, 0x22, 0x25, 0x82, 0x82, 0x97, 0x92, 0xd8, 0xd7, 0x38, 0xb4, 0x9d, 0x19, 0x67, 0x26, 0x85, 0x9e, 0xf4, 0x27, 0xf8, 0xb3, 0x7a, 0x14, 0x4f, 0x1e, 0x6d, 0xfc, 0x23, 0xd2, 0x49, 0x89, 0x85, 0xf4, 0xe0, 0xed, 0x7d, 0xdf, 0xfb, 0xde, 0x9b, 0xf7, 0x7d, 0x0c, 0x6e, 0xc6, 0x92, 0x05, 0x52, 0x09, 0x23, 0x08, 0x91, 0xd3, 0x2c, 0x65, 0x5c, 0x41, 0xca, 0xb4, 0x51, 0xb1, 0x61, 0x82, 0x7b, 0xdd, 0x94, 0x99, 0xfb, 0x2c, 0x09, 0xee, 0xc4, 0x2c, 0x4c, 0x45, 0x2a, 0x42, 0x2b, 0x4d, 0xb2, 0xb1, 0x45, 0x16, 0xd8, 0xaa, 0x58, 0xe1, 0x3f, 0x62, 0x3c, 0xb0, 0x4b, 0xce, 0xf9, 0x58, 0x10, 0x82, 0xeb, 0x66, 0x21, 0xc1, 0x45, 0x6d, 0xd4, 0x69, 0x46, 0xb6, 0x5e, 0x73, 0x3c, 0x9e, 0x81, 0xfb, 0xa3, 0xe0, 0xd6, 0x35, 0xf1, 0x70, 0x03, 0xf8, 0x48, 0x0a, 0xc6, 0x8d, 0x5b, 0xb3, 0x7c, 0x89, 0x49, 0x17, 0x13, 0x9d, 0x49, 0x29, 0x94, 0x81, 0xd1, 0x70, 0x0e, 0x4a, 0x33, 0xc1, 0xb5, 0x5b, 0x6f, 0xd7, 0x3a, 0xcd, 0xa8, 0x55, 0x76, 0xae, 0x37, 0x0d, 0xff, 0x06, 0x93, 0x68, 0xeb, 0xfe, 0x2b, 0x13, 0x9b, 0x4c, 0x93, 0x23, 0xdc, 0x2a, 0xbc, 0x0d, 0x0b, 0x73, 0xa0, 0x60, 0x64, 0xaf, 0x6a, 0x44, 0xff, 0x8b, 0x46, 0x54, 0xf2, 0x64, 0x0f, 0xff, 0x04, 0xa5, 0x84, 0xda, 0x9c, 0x58, 0x00, 0x7f, 0x1f, 0x7b, 0xd5, 0xc5, 0x11, 0x68, 0x29, 0xb8, 0x06, 0xff, 0x1f, 0xfe, 0xb3, 0x76, 0x1c, 0xc1, 0x43, 0x06, 0xda, 0xf4, 0x5f, 0x11, 0xfe, 0xbb, 0xad, 0x26, 0x17, 0xf8, 0xf7, 0x19, 0x18, 0x1b, 0xca, 0x41, 0x50, 0x8d, 0x39, 0xd8, 0x1a, 0xf6, 0xe8, 0x2e, 0xc1, 0x57, 0xaa, 0xbe, 0x43, 0x0c, 0x76, 0x2f, 0x85, 0x61, 0xe3, 0xc5, 0x0e, 0xab, 0x87, 0xbb, 0xa6, 0xab, 0x3a, 0x2f, 0xf8, 0x9e, 0xae, 0x74, 0xe8, 0x9c, 0x0e, 0x96, 0x2b, 0x8a, 0xde, 0x56, 0xd4, 0x79, 0xca, 0x29, 0x5a, 0xe6, 0x14, 0xbd, 0xe4, 0x14, 0xbd, 0xe7, 0x14, 0x3d, 0x7f, 0x50, 0xe7, 0xb6, 0x3f, 0x39, 0xd1, 0x01, 0x13, 0xe1, 0x24, 0x4b, 0x60, 0x0a, 0x26, 0x94, 0x93, 0x34, 0x8c, 0x25, 0xd3, 0x61, 0xf5, 0x99, 0x70, 0xde, 0x4b, 0xc0, 0xc4, 0xbd, 0xe4, 0x97, 0xfd, 0x34, 0xc7, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x96, 0x77, 0xbe, 0xaa, 0x84, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // RegistrationClient is the client API for Registration service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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.ClientConn } func NewRegistrationClient(cc *grpc.ClientConn) RegistrationClient { return ®istrationClient{cc} } func (c *registrationClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*PluginInfo, error) { out := new(PluginInfo) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/GetInfo", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *registrationClient) NotifyRegistrationStatus(ctx context.Context, in *RegistrationStatus, opts ...grpc.CallOption) (*RegistrationStatusResponse, error) { out := new(RegistrationStatusResponse) err := c.cc.Invoke(ctx, "/pluginregistration.Registration/NotifyRegistrationStatus", in, out, opts...) if err != nil { return nil, err } return out, nil } // RegistrationServer is the server API for Registration service. type RegistrationServer interface { GetInfo(context.Context, *InfoRequest) (*PluginInfo, error) NotifyRegistrationStatus(context.Context, *RegistrationStatus) (*RegistrationStatusResponse, error) } // UnimplementedRegistrationServer can be embedded to have forward compatible implementations. type UnimplementedRegistrationServer struct { } func (*UnimplementedRegistrationServer) GetInfo(ctx context.Context, req *InfoRequest) (*PluginInfo, error) { return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") } func (*UnimplementedRegistrationServer) NotifyRegistrationStatus(ctx context.Context, req *RegistrationStatus) (*RegistrationStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method NotifyRegistrationStatus not implemented") } func RegisterRegistrationServer(s *grpc.Server, srv RegistrationServer) { 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: "/pluginregistration.Registration/GetInfo", } 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: "/pluginregistration.Registration/NotifyRegistrationStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(RegistrationServer).NotifyRegistrationStatus(ctx, req.(*RegistrationStatus)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *PluginInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PluginInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PluginInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.SupportedVersions) > 0 { for iNdEx := len(m.SupportedVersions) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.SupportedVersions[iNdEx]) copy(dAtA[i:], m.SupportedVersions[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.SupportedVersions[iNdEx]))) i-- dAtA[i] = 0x22 } } if len(m.Endpoint) > 0 { i -= len(m.Endpoint) copy(dAtA[i:], m.Endpoint) i = encodeVarintApi(dAtA, i, uint64(len(m.Endpoint))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) i = encodeVarintApi(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *RegistrationStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatus) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Error) > 0 { i -= len(m.Error) copy(dAtA[i:], m.Error) i = encodeVarintApi(dAtA, i, uint64(len(m.Error))) i-- dAtA[i] = 0x12 } if m.PluginRegistered { i-- if m.PluginRegistered { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *RegistrationStatusResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *RegistrationStatusResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *RegistrationStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *InfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *InfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *InfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *PluginInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Type) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Endpoint) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.SupportedVersions) > 0 { for _, s := range m.SupportedVersions { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func (m *RegistrationStatus) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.PluginRegistered { n += 2 } l = len(m.Error) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *RegistrationStatusResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *InfoRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *PluginInfo) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&PluginInfo{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Endpoint:` + fmt.Sprintf("%v", this.Endpoint) + `,`, `SupportedVersions:` + fmt.Sprintf("%v", this.SupportedVersions) + `,`, `}`, }, "") return s } func (this *RegistrationStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatus{`, `PluginRegistered:` + fmt.Sprintf("%v", this.PluginRegistered) + `,`, `Error:` + fmt.Sprintf("%v", this.Error) + `,`, `}`, }, "") return s } func (this *RegistrationStatusResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&RegistrationStatusResponse{`, `}`, }, "") return s } func (this *InfoRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&InfoRequest{`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *PluginInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PluginInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PluginInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Endpoint", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Endpoint = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SupportedVersions", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.SupportedVersions = append(m.SupportedVersions, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PluginRegistered", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.PluginRegistered = bool(v != 0) case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Error = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *RegistrationStatusResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: RegistrationStatusResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: RegistrationStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *InfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: InfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: InfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1beta1/api.proto000066400000000000000000000050561503561374700261740ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` 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 string type = 1; // Plugin name that uniquely identifies the plugin for the given plugin type. // For DevicePlugin, this is the resource name that the plugin manages and // should follow the extended resource name convention. // For CSI, this is the CSI driver registrar name. string name = 2; // Optional endpoint location. If found set by Kubelet component, // Kubelet component will use this endpoint for specific requests. // This allows the plugin to register using one endpoint and possibly use // a different socket for control operations. CSI uses this model to delegate // its registration external from the plugin. string endpoint = 3; // Plugin service API versions the plugin supports. // For DevicePlugin, this maps to the deviceplugin API versions the // plugin supports at the given socket. // The Kubelet component communicating with the plugin should be able // to choose any preferred version from this list, or returns an error // if none of the listed versions is supported. repeated string supported_versions = 4; } // RegistrationStatus is the message sent from Kubelet pluginwatcher to the plugin for notification on registration status message RegistrationStatus { // True if plugin gets registered successfully at Kubelet bool plugin_registered = 1; // Error message in case plugin fails to register, empty string otherwise string error = 2; } // RegistrationStatusResponse is sent by plugin to kubelet in response to RegistrationStatus RPC message RegistrationStatusResponse { } // InfoRequest is the empty request message from Kubelet message InfoRequest { } // Registration is the service advertised by the Plugins. service Registration { rpc GetInfo(InfoRequest) returns (PluginInfo) {} rpc NotifyRegistrationStatus(RegistrationStatus) returns (RegistrationStatusResponse) {} } kubelet-kubernetes-1.32.7/pkg/apis/pluginregistration/v1beta1/constants.go000066400000000000000000000013741503561374700267000ustar00rootroot00000000000000/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1beta1 const ( // CSIPlugin identifier for registered CSI plugins CSIPlugin = "CSIPlugin" // DevicePlugin identifier for registered device plugins DevicePlugin = "DevicePlugin" ) kubelet-kubernetes-1.32.7/pkg/apis/podresources/000077500000000000000000000000001503561374700216515ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1/000077500000000000000000000000001503561374700221775ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1/api.pb.go000066400000000000000000003205321503561374700237040ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AllocatableResourcesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AllocatableResourcesRequest) Reset() { *m = AllocatableResourcesRequest{} } func (*AllocatableResourcesRequest) ProtoMessage() {} func (*AllocatableResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *AllocatableResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocatableResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocatableResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocatableResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocatableResourcesRequest.Merge(m, src) } func (m *AllocatableResourcesRequest) XXX_Size() int { return m.Size() } func (m *AllocatableResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_AllocatableResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_AllocatableResourcesRequest proto.InternalMessageInfo // AllocatableResourcesResponses contains informations about all the devices known by the kubelet type AllocatableResourcesResponse struct { Devices []*ContainerDevices `protobuf:"bytes,1,rep,name=devices,proto3" json:"devices,omitempty"` CpuIds []int64 `protobuf:"varint,2,rep,packed,name=cpu_ids,json=cpuIds,proto3" json:"cpu_ids,omitempty"` Memory []*ContainerMemory `protobuf:"bytes,3,rep,name=memory,proto3" json:"memory,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *AllocatableResourcesResponse) Reset() { *m = AllocatableResourcesResponse{} } func (*AllocatableResourcesResponse) ProtoMessage() {} func (*AllocatableResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *AllocatableResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllocatableResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllocatableResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *AllocatableResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_AllocatableResourcesResponse.Merge(m, src) } func (m *AllocatableResourcesResponse) XXX_Size() int { return m.Size() } func (m *AllocatableResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_AllocatableResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_AllocatableResourcesResponse proto.InternalMessageInfo func (m *AllocatableResourcesResponse) GetDevices() []*ContainerDevices { if m != nil { return m.Devices } return nil } func (m *AllocatableResourcesResponse) GetCpuIds() []int64 { if m != nil { return m.CpuIds } return nil } func (m *AllocatableResourcesResponse) GetMemory() []*ContainerMemory { if m != nil { return m.Memory } return nil } // ListPodResourcesRequest is the request made to the PodResourcesLister service type ListPodResourcesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodResourcesRequest) Reset() { *m = ListPodResourcesRequest{} } func (*ListPodResourcesRequest) ProtoMessage() {} func (*ListPodResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *ListPodResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodResourcesRequest.Merge(m, src) } func (m *ListPodResourcesRequest) XXX_Size() int { return m.Size() } func (m *ListPodResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListPodResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_ListPodResourcesRequest proto.InternalMessageInfo // ListPodResourcesResponse is the response returned by List function type ListPodResourcesResponse struct { PodResources []*PodResources `protobuf:"bytes,1,rep,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodResourcesResponse) Reset() { *m = ListPodResourcesResponse{} } func (*ListPodResourcesResponse) ProtoMessage() {} func (*ListPodResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *ListPodResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodResourcesResponse.Merge(m, src) } func (m *ListPodResourcesResponse) XXX_Size() int { return m.Size() } func (m *ListPodResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListPodResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_ListPodResourcesResponse proto.InternalMessageInfo func (m *ListPodResourcesResponse) GetPodResources() []*PodResources { if m != nil { return m.PodResources } return nil } // PodResources contains information about the node resources assigned to a pod type PodResources struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Containers []*ContainerResources `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodResources) Reset() { *m = PodResources{} } func (*PodResources) ProtoMessage() {} func (*PodResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *PodResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodResources) XXX_Merge(src proto.Message) { xxx_messageInfo_PodResources.Merge(m, src) } func (m *PodResources) XXX_Size() int { return m.Size() } func (m *PodResources) XXX_DiscardUnknown() { xxx_messageInfo_PodResources.DiscardUnknown(m) } var xxx_messageInfo_PodResources proto.InternalMessageInfo func (m *PodResources) GetName() string { if m != nil { return m.Name } return "" } func (m *PodResources) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *PodResources) GetContainers() []*ContainerResources { if m != nil { return m.Containers } return nil } // ContainerResources contains information about the resources assigned to a container type ContainerResources struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Devices []*ContainerDevices `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"` CpuIds []int64 `protobuf:"varint,3,rep,packed,name=cpu_ids,json=cpuIds,proto3" json:"cpu_ids,omitempty"` Memory []*ContainerMemory `protobuf:"bytes,4,rep,name=memory,proto3" json:"memory,omitempty"` DynamicResources []*DynamicResource `protobuf:"bytes,5,rep,name=dynamic_resources,json=dynamicResources,proto3" json:"dynamic_resources,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerResources) Reset() { *m = ContainerResources{} } func (*ContainerResources) ProtoMessage() {} func (*ContainerResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{5} } func (m *ContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerResources) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerResources.Merge(m, src) } func (m *ContainerResources) XXX_Size() int { return m.Size() } func (m *ContainerResources) XXX_DiscardUnknown() { xxx_messageInfo_ContainerResources.DiscardUnknown(m) } var xxx_messageInfo_ContainerResources proto.InternalMessageInfo func (m *ContainerResources) GetName() string { if m != nil { return m.Name } return "" } func (m *ContainerResources) GetDevices() []*ContainerDevices { if m != nil { return m.Devices } return nil } func (m *ContainerResources) GetCpuIds() []int64 { if m != nil { return m.CpuIds } return nil } func (m *ContainerResources) GetMemory() []*ContainerMemory { if m != nil { return m.Memory } return nil } func (m *ContainerResources) GetDynamicResources() []*DynamicResource { if m != nil { return m.DynamicResources } return nil } // ContainerMemory contains information about memory and hugepages assigned to a container type ContainerMemory struct { MemoryType string `protobuf:"bytes,1,opt,name=memory_type,json=memoryType,proto3" json:"memory_type,omitempty"` Size_ uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` Topology *TopologyInfo `protobuf:"bytes,3,opt,name=topology,proto3" json:"topology,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerMemory) Reset() { *m = ContainerMemory{} } func (*ContainerMemory) ProtoMessage() {} func (*ContainerMemory) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{6} } func (m *ContainerMemory) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerMemory) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerMemory.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerMemory) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerMemory.Merge(m, src) } func (m *ContainerMemory) XXX_Size() int { return m.Size() } func (m *ContainerMemory) XXX_DiscardUnknown() { xxx_messageInfo_ContainerMemory.DiscardUnknown(m) } var xxx_messageInfo_ContainerMemory proto.InternalMessageInfo func (m *ContainerMemory) GetMemoryType() string { if m != nil { return m.MemoryType } return "" } func (m *ContainerMemory) GetSize_() uint64 { if m != nil { return m.Size_ } return 0 } func (m *ContainerMemory) GetTopology() *TopologyInfo { if m != nil { return m.Topology } return nil } // ContainerDevices contains information about the devices assigned to a container type ContainerDevices struct { ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` DeviceIds []string `protobuf:"bytes,2,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"` Topology *TopologyInfo `protobuf:"bytes,3,opt,name=topology,proto3" json:"topology,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerDevices) Reset() { *m = ContainerDevices{} } func (*ContainerDevices) ProtoMessage() {} func (*ContainerDevices) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{7} } func (m *ContainerDevices) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerDevices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerDevices.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerDevices) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerDevices.Merge(m, src) } func (m *ContainerDevices) XXX_Size() int { return m.Size() } func (m *ContainerDevices) XXX_DiscardUnknown() { xxx_messageInfo_ContainerDevices.DiscardUnknown(m) } var xxx_messageInfo_ContainerDevices proto.InternalMessageInfo func (m *ContainerDevices) GetResourceName() string { if m != nil { return m.ResourceName } return "" } func (m *ContainerDevices) GetDeviceIds() []string { if m != nil { return m.DeviceIds } return nil } func (m *ContainerDevices) GetTopology() *TopologyInfo { if m != nil { return m.Topology } return nil } // Topology describes hardware topology of the resource type TopologyInfo struct { Nodes []*NUMANode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *TopologyInfo) Reset() { *m = TopologyInfo{} } func (*TopologyInfo) ProtoMessage() {} func (*TopologyInfo) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{8} } func (m *TopologyInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *TopologyInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TopologyInfo.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *TopologyInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_TopologyInfo.Merge(m, src) } func (m *TopologyInfo) XXX_Size() int { return m.Size() } func (m *TopologyInfo) XXX_DiscardUnknown() { xxx_messageInfo_TopologyInfo.DiscardUnknown(m) } var xxx_messageInfo_TopologyInfo proto.InternalMessageInfo func (m *TopologyInfo) GetNodes() []*NUMANode { if m != nil { return m.Nodes } return nil } // NUMA representation of NUMA node type NUMANode struct { ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *NUMANode) Reset() { *m = NUMANode{} } func (*NUMANode) ProtoMessage() {} func (*NUMANode) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{9} } func (m *NUMANode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *NUMANode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NUMANode.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *NUMANode) XXX_Merge(src proto.Message) { xxx_messageInfo_NUMANode.Merge(m, src) } func (m *NUMANode) XXX_Size() int { return m.Size() } func (m *NUMANode) XXX_DiscardUnknown() { xxx_messageInfo_NUMANode.DiscardUnknown(m) } var xxx_messageInfo_NUMANode proto.InternalMessageInfo func (m *NUMANode) GetID() int64 { if m != nil { return m.ID } return 0 } // DynamicResource contains information about the devices assigned to a container by DRA type DynamicResource struct { // tombstone: removed in 1.31 because claims are no longer associated with one class // string class_name = 1; ClaimName string `protobuf:"bytes,2,opt,name=claim_name,json=claimName,proto3" json:"claim_name,omitempty"` ClaimNamespace string `protobuf:"bytes,3,opt,name=claim_namespace,json=claimNamespace,proto3" json:"claim_namespace,omitempty"` ClaimResources []*ClaimResource `protobuf:"bytes,4,rep,name=claim_resources,json=claimResources,proto3" json:"claim_resources,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *DynamicResource) Reset() { *m = DynamicResource{} } func (*DynamicResource) ProtoMessage() {} func (*DynamicResource) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{10} } func (m *DynamicResource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *DynamicResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DynamicResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *DynamicResource) XXX_Merge(src proto.Message) { xxx_messageInfo_DynamicResource.Merge(m, src) } func (m *DynamicResource) XXX_Size() int { return m.Size() } func (m *DynamicResource) XXX_DiscardUnknown() { xxx_messageInfo_DynamicResource.DiscardUnknown(m) } var xxx_messageInfo_DynamicResource proto.InternalMessageInfo func (m *DynamicResource) GetClaimName() string { if m != nil { return m.ClaimName } return "" } func (m *DynamicResource) GetClaimNamespace() string { if m != nil { return m.ClaimNamespace } return "" } func (m *DynamicResource) GetClaimResources() []*ClaimResource { if m != nil { return m.ClaimResources } return nil } // ClaimResource contains resource information. The driver name/pool name/device name // triplet uniquely identifies the device. Should DRA get extended to other kinds // of resources, then device_name will be empty and other fields will get added. // Each device at the DRA API level may map to zero or more CDI devices. type ClaimResource struct { CDIDevices []*CDIDevice `protobuf:"bytes,1,rep,name=cdi_devices,json=cdiDevices,proto3" json:"cdi_devices,omitempty"` DriverName string `protobuf:"bytes,2,opt,name=driver_name,json=driverName,proto3" json:"driver_name,omitempty"` PoolName string `protobuf:"bytes,3,opt,name=pool_name,json=poolName,proto3" json:"pool_name,omitempty"` DeviceName string `protobuf:"bytes,4,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ClaimResource) Reset() { *m = ClaimResource{} } func (*ClaimResource) ProtoMessage() {} func (*ClaimResource) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{11} } func (m *ClaimResource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ClaimResource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ClaimResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ClaimResource) XXX_Merge(src proto.Message) { xxx_messageInfo_ClaimResource.Merge(m, src) } func (m *ClaimResource) XXX_Size() int { return m.Size() } func (m *ClaimResource) XXX_DiscardUnknown() { xxx_messageInfo_ClaimResource.DiscardUnknown(m) } var xxx_messageInfo_ClaimResource proto.InternalMessageInfo func (m *ClaimResource) GetCDIDevices() []*CDIDevice { if m != nil { return m.CDIDevices } return nil } func (m *ClaimResource) GetDriverName() string { if m != nil { return m.DriverName } return "" } func (m *ClaimResource) GetPoolName() string { if m != nil { return m.PoolName } return "" } func (m *ClaimResource) GetDeviceName() string { if m != nil { return m.DeviceName } return "" } // CDIDevice specifies a CDI device information type CDIDevice struct { // Fully qualified CDI device name // for example: vendor.com/gpu=gpudevice1 // see more details in the CDI specification: // https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *CDIDevice) Reset() { *m = CDIDevice{} } func (*CDIDevice) ProtoMessage() {} func (*CDIDevice) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{12} } func (m *CDIDevice) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *CDIDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CDIDevice.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *CDIDevice) XXX_Merge(src proto.Message) { xxx_messageInfo_CDIDevice.Merge(m, src) } func (m *CDIDevice) XXX_Size() int { return m.Size() } func (m *CDIDevice) XXX_DiscardUnknown() { xxx_messageInfo_CDIDevice.DiscardUnknown(m) } var xxx_messageInfo_CDIDevice proto.InternalMessageInfo func (m *CDIDevice) GetName() string { if m != nil { return m.Name } return "" } // GetPodResourcesRequest contains information about the pod type GetPodResourcesRequest struct { PodName string `protobuf:"bytes,1,opt,name=pod_name,json=podName,proto3" json:"pod_name,omitempty"` PodNamespace string `protobuf:"bytes,2,opt,name=pod_namespace,json=podNamespace,proto3" json:"pod_namespace,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *GetPodResourcesRequest) Reset() { *m = GetPodResourcesRequest{} } func (*GetPodResourcesRequest) ProtoMessage() {} func (*GetPodResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{13} } func (m *GetPodResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *GetPodResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GetPodResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *GetPodResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_GetPodResourcesRequest.Merge(m, src) } func (m *GetPodResourcesRequest) XXX_Size() int { return m.Size() } func (m *GetPodResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_GetPodResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_GetPodResourcesRequest proto.InternalMessageInfo func (m *GetPodResourcesRequest) GetPodName() string { if m != nil { return m.PodName } return "" } func (m *GetPodResourcesRequest) GetPodNamespace() string { if m != nil { return m.PodNamespace } return "" } // GetPodResourcesResponse contains information about the pod the devices type GetPodResourcesResponse struct { PodResources *PodResources `protobuf:"bytes,1,opt,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *GetPodResourcesResponse) Reset() { *m = GetPodResourcesResponse{} } func (*GetPodResourcesResponse) ProtoMessage() {} func (*GetPodResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{14} } func (m *GetPodResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *GetPodResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GetPodResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *GetPodResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_GetPodResourcesResponse.Merge(m, src) } func (m *GetPodResourcesResponse) XXX_Size() int { return m.Size() } func (m *GetPodResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_GetPodResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_GetPodResourcesResponse proto.InternalMessageInfo func (m *GetPodResourcesResponse) GetPodResources() *PodResources { if m != nil { return m.PodResources } return nil } func init() { proto.RegisterType((*AllocatableResourcesRequest)(nil), "v1.AllocatableResourcesRequest") proto.RegisterType((*AllocatableResourcesResponse)(nil), "v1.AllocatableResourcesResponse") proto.RegisterType((*ListPodResourcesRequest)(nil), "v1.ListPodResourcesRequest") proto.RegisterType((*ListPodResourcesResponse)(nil), "v1.ListPodResourcesResponse") proto.RegisterType((*PodResources)(nil), "v1.PodResources") proto.RegisterType((*ContainerResources)(nil), "v1.ContainerResources") proto.RegisterType((*ContainerMemory)(nil), "v1.ContainerMemory") proto.RegisterType((*ContainerDevices)(nil), "v1.ContainerDevices") proto.RegisterType((*TopologyInfo)(nil), "v1.TopologyInfo") proto.RegisterType((*NUMANode)(nil), "v1.NUMANode") proto.RegisterType((*DynamicResource)(nil), "v1.DynamicResource") proto.RegisterType((*ClaimResource)(nil), "v1.ClaimResource") proto.RegisterType((*CDIDevice)(nil), "v1.CDIDevice") proto.RegisterType((*GetPodResourcesRequest)(nil), "v1.GetPodResourcesRequest") proto.RegisterType((*GetPodResourcesResponse)(nil), "v1.GetPodResourcesResponse") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 789 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4d, 0x6f, 0xda, 0x48, 0x18, 0xce, 0x60, 0x92, 0xc0, 0x0b, 0xe4, 0x63, 0x76, 0x95, 0x10, 0x48, 0x00, 0x39, 0x87, 0x44, 0xda, 0x5d, 0x50, 0xb2, 0xda, 0xd5, 0x6a, 0x0f, 0xab, 0x7c, 0xb0, 0x8a, 0x90, 0x36, 0x51, 0xd6, 0x4a, 0xa5, 0xaa, 0x87, 0x22, 0x63, 0x4f, 0xa8, 0x15, 0x60, 0xa6, 0x1e, 0x83, 0x4a, 0x4f, 0x3d, 0xf4, 0x07, 0xf4, 0xd0, 0xfe, 0x8d, 0xfe, 0x8e, 0x1c, 0x7b, 0xec, 0xa9, 0x4a, 0xe8, 0xcf, 0xe8, 0xa5, 0x9a, 0x19, 0xdb, 0x18, 0x30, 0x8d, 0x72, 0x62, 0xe6, 0x79, 0x9e, 0xf7, 0x9d, 0xf7, 0x8b, 0xd7, 0x90, 0x36, 0x99, 0x53, 0x65, 0x2e, 0xf5, 0x28, 0x4e, 0x0c, 0x0e, 0x0a, 0xbf, 0xb5, 0x1d, 0xef, 0x45, 0xbf, 0x55, 0xb5, 0x68, 0xb7, 0xd6, 0xa6, 0x6d, 0x5a, 0x93, 0x54, 0xab, 0x7f, 0x2d, 0x6f, 0xf2, 0x22, 0x4f, 0xca, 0x44, 0xdf, 0x81, 0xe2, 0x71, 0xa7, 0x43, 0x2d, 0xd3, 0x33, 0x5b, 0x1d, 0x62, 0x10, 0x4e, 0xfb, 0xae, 0x45, 0xb8, 0x41, 0x5e, 0xf6, 0x09, 0xf7, 0xf4, 0xf7, 0x08, 0xb6, 0xe3, 0x79, 0xce, 0x68, 0x8f, 0x13, 0x5c, 0x85, 0x65, 0x9b, 0x0c, 0x1c, 0x8b, 0xf0, 0x3c, 0xaa, 0x68, 0xfb, 0x99, 0xc3, 0x9f, 0xab, 0x83, 0x83, 0xea, 0x29, 0xed, 0x79, 0xa6, 0xd3, 0x23, 0x6e, 0x5d, 0x71, 0x46, 0x20, 0xc2, 0x9b, 0xb0, 0x6c, 0xb1, 0x7e, 0xd3, 0xb1, 0x79, 0x3e, 0x51, 0xd1, 0xf6, 0x35, 0x63, 0xc9, 0x62, 0xfd, 0x86, 0xcd, 0xf1, 0x2f, 0xb0, 0xd4, 0x25, 0x5d, 0xea, 0x0e, 0xf3, 0x9a, 0xf4, 0xf3, 0xd3, 0x84, 0x9f, 0x73, 0x49, 0x19, 0xbe, 0x44, 0xdf, 0x82, 0xcd, 0xff, 0x1c, 0xee, 0x5d, 0x52, 0x7b, 0x26, 0xe2, 0xff, 0x21, 0x3f, 0x4b, 0xf9, 0xc1, 0xfe, 0x01, 0x39, 0x46, 0xed, 0xa6, 0x1b, 0x10, 0x7e, 0xc8, 0x6b, 0xe2, 0xa9, 0x09, 0x83, 0x2c, 0x8b, 0xdc, 0xf4, 0x57, 0x90, 0x8d, 0xb2, 0x18, 0x43, 0xb2, 0x67, 0x76, 0x49, 0x1e, 0x55, 0xd0, 0x7e, 0xda, 0x90, 0x67, 0xbc, 0x0d, 0x69, 0xf1, 0xcb, 0x99, 0x69, 0x91, 0x7c, 0x42, 0x12, 0x63, 0x00, 0xff, 0x09, 0x60, 0x05, 0xa9, 0x70, 0x3f, 0xc1, 0x8d, 0x89, 0x04, 0xc7, 0x6f, 0x47, 0x94, 0xfa, 0x1d, 0x02, 0x3c, 0x2b, 0x89, 0x0d, 0x20, 0xd2, 0x88, 0xc4, 0x23, 0x1b, 0xa1, 0xcd, 0x69, 0x44, 0xf2, 0xc1, 0x46, 0xe0, 0x23, 0x58, 0xb7, 0x87, 0x3d, 0xb3, 0xeb, 0x58, 0x91, 0xaa, 0x2e, 0x8e, 0xed, 0xea, 0x8a, 0x0c, 0x42, 0x37, 0xd6, 0xec, 0x49, 0x80, 0xeb, 0x1e, 0xac, 0x4e, 0x39, 0xc7, 0x65, 0xc8, 0x28, 0xf7, 0x4d, 0x6f, 0xc8, 0x82, 0x2c, 0x41, 0x41, 0x57, 0x43, 0x46, 0x44, 0xfe, 0xdc, 0x79, 0xad, 0xea, 0x9c, 0x34, 0xe4, 0x19, 0xff, 0x0a, 0x29, 0x8f, 0x32, 0xda, 0xa1, 0x6d, 0x31, 0x41, 0x28, 0x68, 0xeb, 0x95, 0x8f, 0x35, 0x7a, 0xd7, 0xd4, 0x08, 0x15, 0xfa, 0x5b, 0x04, 0x6b, 0xd3, 0xb5, 0xc1, 0xbb, 0x90, 0x0b, 0x92, 0x68, 0x46, 0xea, 0x9b, 0x0d, 0xc0, 0x0b, 0x51, 0xe7, 0x1d, 0x00, 0x55, 0xc2, 0x70, 0x86, 0xd3, 0x46, 0x5a, 0x21, 0xa2, 0x7a, 0x8f, 0x0b, 0xe3, 0x10, 0xb2, 0x51, 0x06, 0xeb, 0xb0, 0xd8, 0xa3, 0x76, 0x38, 0x98, 0x59, 0x61, 0x7a, 0xf1, 0xe4, 0xfc, 0xf8, 0x82, 0xda, 0xc4, 0x50, 0x94, 0x5e, 0x80, 0x54, 0x00, 0xe1, 0x15, 0x48, 0x34, 0xea, 0x32, 0x4c, 0xcd, 0x48, 0x34, 0xea, 0xfa, 0x07, 0x04, 0xab, 0x53, 0x25, 0x17, 0x01, 0x5b, 0x1d, 0xd3, 0xe9, 0xaa, 0x94, 0xfc, 0xd1, 0x94, 0x88, 0xcc, 0x67, 0x0f, 0x56, 0xc7, 0xb4, 0x1a, 0x5f, 0x4d, 0x6a, 0x56, 0x42, 0x8d, 0x9a, 0xe1, 0xbf, 0x03, 0xe1, 0xb8, 0xd1, 0x6a, 0x40, 0xd6, 0xe5, 0x80, 0x08, 0x2a, 0x6c, 0xb3, 0xb2, 0x1d, 0x37, 0xf9, 0x23, 0x82, 0xdc, 0x84, 0x02, 0xff, 0x03, 0x19, 0xcb, 0x76, 0x9a, 0x93, 0xbb, 0x23, 0x27, 0x3d, 0xd5, 0x1b, 0xaa, 0x21, 0x27, 0x2b, 0xa3, 0x2f, 0x65, 0x08, 0xaf, 0xe2, 0x9f, 0x61, 0x3b, 0x41, 0xaf, 0xca, 0x90, 0xb1, 0x5d, 0x67, 0x40, 0xdc, 0x68, 0x5a, 0xa0, 0x20, 0x99, 0x57, 0x11, 0xd2, 0x8c, 0xd2, 0x8e, 0xa2, 0x55, 0x46, 0x29, 0x01, 0x48, 0x52, 0x58, 0xab, 0x26, 0x4a, 0x3a, 0xe9, 0x5b, 0x4b, 0x48, 0x08, 0xf4, 0x32, 0xa4, 0xc3, 0x87, 0xe3, 0xfe, 0x6e, 0xfa, 0x53, 0xd8, 0x38, 0x23, 0x71, 0x0b, 0x08, 0x6f, 0x41, 0x4a, 0x2c, 0x99, 0x88, 0xc5, 0x32, 0xa3, 0xb6, 0x7c, 0x76, 0x57, 0xed, 0x9f, 0xe9, 0x45, 0x91, 0xf5, 0x79, 0x89, 0xe9, 0x97, 0xb0, 0x39, 0xe3, 0x79, 0xfe, 0xfe, 0x42, 0x0f, 0xef, 0xaf, 0xc3, 0x6f, 0x08, 0x70, 0x94, 0x16, 0xfb, 0x91, 0xb8, 0xf8, 0x14, 0x92, 0xe2, 0x84, 0x8b, 0xc2, 0x7c, 0xce, 0x3a, 0x2d, 0x6c, 0xc7, 0x93, 0x2a, 0x20, 0x7d, 0x01, 0x3f, 0x97, 0xd1, 0xc6, 0x7d, 0x22, 0x70, 0x59, 0x98, 0xfe, 0xe0, 0xe3, 0x52, 0xa8, 0xcc, 0x17, 0x84, 0xfe, 0x8f, 0x40, 0x3b, 0x23, 0x1e, 0x2e, 0x08, 0x69, 0x7c, 0xc1, 0x0b, 0xc5, 0x58, 0x2e, 0xf0, 0x70, 0xf2, 0xef, 0xed, 0x7d, 0x09, 0x7d, 0xbe, 0x2f, 0x2d, 0xbc, 0x19, 0x95, 0xd0, 0xed, 0xa8, 0x84, 0x3e, 0x8d, 0x4a, 0xe8, 0x6e, 0x54, 0x42, 0xef, 0xbe, 0x96, 0x16, 0x9e, 0xed, 0xdd, 0xfc, 0xc5, 0xab, 0x0e, 0xad, 0xdd, 0xf4, 0x5b, 0xa4, 0x43, 0xbc, 0x1a, 0xbb, 0x69, 0xd7, 0x4c, 0xe6, 0xf0, 0x1a, 0xa3, 0x76, 0x58, 0xe7, 0xda, 0xe0, 0xa0, 0xb5, 0x24, 0xbf, 0x97, 0xbf, 0x7f, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x8c, 0x1b, 0x18, 0xf9, 0x6f, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // PodResourcesListerClient is the client API for PodResourcesLister service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 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.ClientConn } func NewPodResourcesListerClient(cc *grpc.ClientConn) PodResourcesListerClient { return &podResourcesListerClient{cc} } func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) { out := new(ListPodResourcesResponse) err := c.cc.Invoke(ctx, "/v1.PodResourcesLister/List", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *podResourcesListerClient) GetAllocatableResources(ctx context.Context, in *AllocatableResourcesRequest, opts ...grpc.CallOption) (*AllocatableResourcesResponse, error) { out := new(AllocatableResourcesResponse) err := c.cc.Invoke(ctx, "/v1.PodResourcesLister/GetAllocatableResources", in, out, opts...) if err != nil { return nil, err } return out, nil } func (c *podResourcesListerClient) Get(ctx context.Context, in *GetPodResourcesRequest, opts ...grpc.CallOption) (*GetPodResourcesResponse, error) { out := new(GetPodResourcesResponse) err := c.cc.Invoke(ctx, "/v1.PodResourcesLister/Get", in, out, opts...) if err != nil { return nil, err } return out, nil } // PodResourcesListerServer is the server API for PodResourcesLister service. type PodResourcesListerServer interface { List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error) GetAllocatableResources(context.Context, *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error) Get(context.Context, *GetPodResourcesRequest) (*GetPodResourcesResponse, error) } // UnimplementedPodResourcesListerServer can be embedded to have forward compatible implementations. type UnimplementedPodResourcesListerServer struct { } func (*UnimplementedPodResourcesListerServer) List(ctx context.Context, req *ListPodResourcesRequest) (*ListPodResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } func (*UnimplementedPodResourcesListerServer) GetAllocatableResources(ctx context.Context, req *AllocatableResourcesRequest) (*AllocatableResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAllocatableResources not implemented") } func (*UnimplementedPodResourcesListerServer) Get(ctx context.Context, req *GetPodResourcesRequest) (*GetPodResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") } func RegisterPodResourcesListerServer(s *grpc.Server, srv PodResourcesListerServer) { 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: "/v1.PodResourcesLister/List", } 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: "/v1.PodResourcesLister/GetAllocatableResources", } 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: "/v1.PodResourcesLister/Get", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PodResourcesListerServer).Get(ctx, req.(*GetPodResourcesRequest)) } return interceptor(ctx, in, info, handler) } 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: "api.proto", } func (m *AllocatableResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocatableResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocatableResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *AllocatableResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *AllocatableResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *AllocatableResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Memory) > 0 { for iNdEx := len(m.Memory) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Memory[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.CpuIds) > 0 { dAtA2 := make([]byte, len(m.CpuIds)*10) var j1 int for _, num1 := range m.CpuIds { num := uint64(num1) for num >= 1<<7 { dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j1++ } dAtA2[j1] = uint8(num) j1++ } i -= j1 copy(dAtA[i:], dAtA2[:j1]) i = encodeVarintApi(dAtA, i, uint64(j1)) i-- dAtA[i] = 0x12 } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *ListPodResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ListPodResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodResources) > 0 { for iNdEx := len(m.PodResources) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.PodResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PodResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Containers) > 0 { for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DynamicResources) > 0 { for iNdEx := len(m.DynamicResources) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.DynamicResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x2a } } if len(m.Memory) > 0 { for iNdEx := len(m.Memory) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Memory[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } if len(m.CpuIds) > 0 { dAtA4 := make([]byte, len(m.CpuIds)*10) var j3 int for _, num1 := range m.CpuIds { num := uint64(num1) for num >= 1<<7 { dAtA4[j3] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 j3++ } dAtA4[j3] = uint8(num) j3++ } i -= j3 copy(dAtA[i:], dAtA4[:j3]) i = encodeVarintApi(dAtA, i, uint64(j3)) i-- dAtA[i] = 0x1a } if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerMemory) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerMemory) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerMemory) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Topology != nil { { size, err := m.Topology.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if m.Size_ != 0 { i = encodeVarintApi(dAtA, i, uint64(m.Size_)) i-- dAtA[i] = 0x10 } if len(m.MemoryType) > 0 { i -= len(m.MemoryType) copy(dAtA[i:], m.MemoryType) i = encodeVarintApi(dAtA, i, uint64(len(m.MemoryType))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerDevices) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerDevices) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerDevices) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Topology != nil { { size, err := m.Topology.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } if len(m.DeviceIds) > 0 { for iNdEx := len(m.DeviceIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DeviceIds[iNdEx]) copy(dAtA[i:], m.DeviceIds[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceIds[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.ResourceName) > 0 { i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *TopologyInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *TopologyInfo) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *TopologyInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Nodes) > 0 { for iNdEx := len(m.Nodes) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Nodes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *NUMANode) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *NUMANode) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *NUMANode) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.ID != 0 { i = encodeVarintApi(dAtA, i, uint64(m.ID)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *DynamicResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *DynamicResource) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *DynamicResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.ClaimResources) > 0 { for iNdEx := len(m.ClaimResources) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.ClaimResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } if len(m.ClaimNamespace) > 0 { i -= len(m.ClaimNamespace) copy(dAtA[i:], m.ClaimNamespace) i = encodeVarintApi(dAtA, i, uint64(len(m.ClaimNamespace))) i-- dAtA[i] = 0x1a } if len(m.ClaimName) > 0 { i -= len(m.ClaimName) copy(dAtA[i:], m.ClaimName) i = encodeVarintApi(dAtA, i, uint64(len(m.ClaimName))) i-- dAtA[i] = 0x12 } return len(dAtA) - i, nil } func (m *ClaimResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ClaimResource) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ClaimResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DeviceName) > 0 { i -= len(m.DeviceName) copy(dAtA[i:], m.DeviceName) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceName))) i-- dAtA[i] = 0x22 } if len(m.PoolName) > 0 { i -= len(m.PoolName) copy(dAtA[i:], m.PoolName) i = encodeVarintApi(dAtA, i, uint64(len(m.PoolName))) i-- dAtA[i] = 0x1a } if len(m.DriverName) > 0 { i -= len(m.DriverName) copy(dAtA[i:], m.DriverName) i = encodeVarintApi(dAtA, i, uint64(len(m.DriverName))) i-- dAtA[i] = 0x12 } if len(m.CDIDevices) > 0 { for iNdEx := len(m.CDIDevices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.CDIDevices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *CDIDevice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CDIDevice) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *CDIDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *GetPodResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *GetPodResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *GetPodResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodNamespace) > 0 { i -= len(m.PodNamespace) copy(dAtA[i:], m.PodNamespace) i = encodeVarintApi(dAtA, i, uint64(len(m.PodNamespace))) i-- dAtA[i] = 0x12 } if len(m.PodName) > 0 { i -= len(m.PodName) copy(dAtA[i:], m.PodName) i = encodeVarintApi(dAtA, i, uint64(len(m.PodName))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *GetPodResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *GetPodResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *GetPodResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.PodResources != nil { { size, err := m.PodResources.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *AllocatableResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *AllocatableResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.CpuIds) > 0 { l = 0 for _, e := range m.CpuIds { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } if len(m.Memory) > 0 { for _, e := range m.Memory { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ListPodResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ListPodResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.PodResources) > 0 { for _, e := range m.PodResources { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *PodResources) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Containers) > 0 { for _, e := range m.Containers { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.CpuIds) > 0 { l = 0 for _, e := range m.CpuIds { l += sovApi(uint64(e)) } n += 1 + sovApi(uint64(l)) + l } if len(m.Memory) > 0 { for _, e := range m.Memory { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } if len(m.DynamicResources) > 0 { for _, e := range m.DynamicResources { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerMemory) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.MemoryType) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if m.Size_ != 0 { n += 1 + sovApi(uint64(m.Size_)) } if m.Topology != nil { l = m.Topology.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *ContainerDevices) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ResourceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.DeviceIds) > 0 { for _, s := range m.DeviceIds { l = len(s) n += 1 + l + sovApi(uint64(l)) } } if m.Topology != nil { l = m.Topology.Size() n += 1 + l + sovApi(uint64(l)) } return n } func (m *TopologyInfo) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.Nodes) > 0 { for _, e := range m.Nodes { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *NUMANode) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.ID != 0 { n += 1 + sovApi(uint64(m.ID)) } return n } func (m *DynamicResource) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ClaimName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.ClaimNamespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.ClaimResources) > 0 { for _, e := range m.ClaimResources { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ClaimResource) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.CDIDevices) > 0 { for _, e := range m.CDIDevices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } l = len(m.DriverName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PoolName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.DeviceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *CDIDevice) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *GetPodResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.PodName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.PodNamespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } return n } func (m *GetPodResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.PodResources != nil { l = m.PodResources.Size() n += 1 + l + sovApi(uint64(l)) } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *AllocatableResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&AllocatableResourcesRequest{`, `}`, }, "") return s } func (this *AllocatableResourcesResponse) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*ContainerDevices{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "ContainerDevices", "ContainerDevices", 1) + "," } repeatedStringForDevices += "}" repeatedStringForMemory := "[]*ContainerMemory{" for _, f := range this.Memory { repeatedStringForMemory += strings.Replace(f.String(), "ContainerMemory", "ContainerMemory", 1) + "," } repeatedStringForMemory += "}" s := strings.Join([]string{`&AllocatableResourcesResponse{`, `Devices:` + repeatedStringForDevices + `,`, `CpuIds:` + fmt.Sprintf("%v", this.CpuIds) + `,`, `Memory:` + repeatedStringForMemory + `,`, `}`, }, "") return s } func (this *ListPodResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPodResourcesRequest{`, `}`, }, "") return s } func (this *ListPodResourcesResponse) String() string { if this == nil { return "nil" } repeatedStringForPodResources := "[]*PodResources{" for _, f := range this.PodResources { repeatedStringForPodResources += strings.Replace(f.String(), "PodResources", "PodResources", 1) + "," } repeatedStringForPodResources += "}" s := strings.Join([]string{`&ListPodResourcesResponse{`, `PodResources:` + repeatedStringForPodResources + `,`, `}`, }, "") return s } func (this *PodResources) String() string { if this == nil { return "nil" } repeatedStringForContainers := "[]*ContainerResources{" for _, f := range this.Containers { repeatedStringForContainers += strings.Replace(f.String(), "ContainerResources", "ContainerResources", 1) + "," } repeatedStringForContainers += "}" s := strings.Join([]string{`&PodResources{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Containers:` + repeatedStringForContainers + `,`, `}`, }, "") return s } func (this *ContainerResources) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*ContainerDevices{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "ContainerDevices", "ContainerDevices", 1) + "," } repeatedStringForDevices += "}" repeatedStringForMemory := "[]*ContainerMemory{" for _, f := range this.Memory { repeatedStringForMemory += strings.Replace(f.String(), "ContainerMemory", "ContainerMemory", 1) + "," } repeatedStringForMemory += "}" repeatedStringForDynamicResources := "[]*DynamicResource{" for _, f := range this.DynamicResources { repeatedStringForDynamicResources += strings.Replace(f.String(), "DynamicResource", "DynamicResource", 1) + "," } repeatedStringForDynamicResources += "}" s := strings.Join([]string{`&ContainerResources{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Devices:` + repeatedStringForDevices + `,`, `CpuIds:` + fmt.Sprintf("%v", this.CpuIds) + `,`, `Memory:` + repeatedStringForMemory + `,`, `DynamicResources:` + repeatedStringForDynamicResources + `,`, `}`, }, "") return s } func (this *ContainerMemory) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerMemory{`, `MemoryType:` + fmt.Sprintf("%v", this.MemoryType) + `,`, `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, `Topology:` + strings.Replace(this.Topology.String(), "TopologyInfo", "TopologyInfo", 1) + `,`, `}`, }, "") return s } func (this *ContainerDevices) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerDevices{`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `DeviceIds:` + fmt.Sprintf("%v", this.DeviceIds) + `,`, `Topology:` + strings.Replace(this.Topology.String(), "TopologyInfo", "TopologyInfo", 1) + `,`, `}`, }, "") return s } func (this *TopologyInfo) String() string { if this == nil { return "nil" } repeatedStringForNodes := "[]*NUMANode{" for _, f := range this.Nodes { repeatedStringForNodes += strings.Replace(f.String(), "NUMANode", "NUMANode", 1) + "," } repeatedStringForNodes += "}" s := strings.Join([]string{`&TopologyInfo{`, `Nodes:` + repeatedStringForNodes + `,`, `}`, }, "") return s } func (this *NUMANode) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&NUMANode{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `}`, }, "") return s } func (this *DynamicResource) String() string { if this == nil { return "nil" } repeatedStringForClaimResources := "[]*ClaimResource{" for _, f := range this.ClaimResources { repeatedStringForClaimResources += strings.Replace(f.String(), "ClaimResource", "ClaimResource", 1) + "," } repeatedStringForClaimResources += "}" s := strings.Join([]string{`&DynamicResource{`, `ClaimName:` + fmt.Sprintf("%v", this.ClaimName) + `,`, `ClaimNamespace:` + fmt.Sprintf("%v", this.ClaimNamespace) + `,`, `ClaimResources:` + repeatedStringForClaimResources + `,`, `}`, }, "") return s } func (this *ClaimResource) String() string { if this == nil { return "nil" } repeatedStringForCDIDevices := "[]*CDIDevice{" for _, f := range this.CDIDevices { repeatedStringForCDIDevices += strings.Replace(f.String(), "CDIDevice", "CDIDevice", 1) + "," } repeatedStringForCDIDevices += "}" s := strings.Join([]string{`&ClaimResource{`, `CDIDevices:` + repeatedStringForCDIDevices + `,`, `DriverName:` + fmt.Sprintf("%v", this.DriverName) + `,`, `PoolName:` + fmt.Sprintf("%v", this.PoolName) + `,`, `DeviceName:` + fmt.Sprintf("%v", this.DeviceName) + `,`, `}`, }, "") return s } func (this *CDIDevice) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CDIDevice{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") return s } func (this *GetPodResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&GetPodResourcesRequest{`, `PodName:` + fmt.Sprintf("%v", this.PodName) + `,`, `PodNamespace:` + fmt.Sprintf("%v", this.PodNamespace) + `,`, `}`, }, "") return s } func (this *GetPodResourcesResponse) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&GetPodResourcesResponse{`, `PodResources:` + strings.Replace(this.PodResources.String(), "PodResources", "PodResources", 1) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *AllocatableResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocatableResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocatableResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *AllocatableResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: AllocatableResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: AllocatableResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &ContainerDevices{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.CpuIds = append(m.CpuIds, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.CpuIds) == 0 { m.CpuIds = make([]int64, 0, elementCount) } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.CpuIds = append(m.CpuIds, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field CpuIds", wireType) } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Memory = append(m.Memory, &ContainerMemory{}) if err := m.Memory[len(m.Memory)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodResources = append(m.PodResources, &PodResources{}) if err := m.PodResources[len(m.PodResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Containers = append(m.Containers, &ContainerResources{}) if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &ContainerDevices{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType == 0 { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.CpuIds = append(m.CpuIds, v) } else if wireType == 2 { var packedLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ packedLen |= int(b&0x7F) << shift if b < 0x80 { break } } if packedLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + packedLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } var elementCount int var count int for _, integer := range dAtA[iNdEx:postIndex] { if integer < 128 { count++ } } elementCount = count if elementCount != 0 && len(m.CpuIds) == 0 { m.CpuIds = make([]int64, 0, elementCount) } for iNdEx < postIndex { var v int64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int64(b&0x7F) << shift if b < 0x80 { break } } m.CpuIds = append(m.CpuIds, v) } } else { return fmt.Errorf("proto: wrong wireType = %d for field CpuIds", wireType) } case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Memory", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Memory = append(m.Memory, &ContainerMemory{}) if err := m.Memory[len(m.Memory)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DynamicResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DynamicResources = append(m.DynamicResources, &DynamicResource{}) if err := m.DynamicResources[len(m.DynamicResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerMemory) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerMemory: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerMemory: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MemoryType", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.MemoryType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) } m.Size_ = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Size_ |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Topology == nil { m.Topology = &TopologyInfo{} } if err := m.Topology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerDevices) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerDevices: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerDevices: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceIds = append(m.DeviceIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.Topology == nil { m.Topology = &TopologyInfo{} } if err := m.Topology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *TopologyInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: TopologyInfo: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: TopologyInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Nodes", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Nodes = append(m.Nodes, &NUMANode{}) if err := m.Nodes[len(m.Nodes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *NUMANode) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: NUMANode: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: NUMANode: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } m.ID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.ID |= int64(b&0x7F) << shift if b < 0x80 { break } } default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *DynamicResource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: DynamicResource: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: DynamicResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ClaimName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimNamespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ClaimNamespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ClaimResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ClaimResources = append(m.ClaimResources, &ClaimResource{}) if err := m.ClaimResources[len(m.ClaimResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ClaimResource) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ClaimResource: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ClaimResource: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CDIDevices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.CDIDevices = append(m.CDIDevices, &CDIDevice{}) if err := m.CDIDevices[len(m.CDIDevices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DriverName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DriverName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PoolName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PoolName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CDIDevice) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CDIDevice: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CDIDevice: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *GetPodResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: GetPodResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: GetPodResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodNamespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodNamespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *GetPodResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: GetPodResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: GetPodResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } if m.PodResources == nil { m.PodResources = &PodResources{} } if err := m.PodResources.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1/api.proto000066400000000000000000000100471503561374700240370ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package v1; option go_package = "k8s.io/kubelet/pkg/apis/podresources/v1"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; // PodResourcesLister is a service provided by the kubelet that provides information about the // node resources consumed by pods and containers on the node service PodResourcesLister { rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {} rpc GetAllocatableResources(AllocatableResourcesRequest) returns (AllocatableResourcesResponse) {} rpc Get(GetPodResourcesRequest) returns (GetPodResourcesResponse) {} } message AllocatableResourcesRequest {} // AllocatableResourcesResponses contains informations about all the devices known by the kubelet message AllocatableResourcesResponse { repeated ContainerDevices devices = 1; repeated int64 cpu_ids = 2; repeated ContainerMemory memory = 3; } // ListPodResourcesRequest is the request made to the PodResourcesLister service message ListPodResourcesRequest {} // ListPodResourcesResponse is the response returned by List function message ListPodResourcesResponse { repeated PodResources pod_resources = 1; } // PodResources contains information about the node resources assigned to a pod message PodResources { string name = 1; string namespace = 2; repeated ContainerResources containers = 3; } // ContainerResources contains information about the resources assigned to a container message ContainerResources { string name = 1; repeated ContainerDevices devices = 2; repeated int64 cpu_ids = 3; repeated ContainerMemory memory = 4; repeated DynamicResource dynamic_resources = 5; } // ContainerMemory contains information about memory and hugepages assigned to a container message ContainerMemory { string memory_type = 1; uint64 size = 2; TopologyInfo topology = 3; } // ContainerDevices contains information about the devices assigned to a container message ContainerDevices { string resource_name = 1; repeated string device_ids = 2; TopologyInfo topology = 3; } // Topology describes hardware topology of the resource message TopologyInfo { repeated NUMANode nodes = 1; } // NUMA representation of NUMA node message NUMANode { int64 ID = 1; } // DynamicResource contains information about the devices assigned to a container by DRA message DynamicResource { // tombstone: removed in 1.31 because claims are no longer associated with one class // string class_name = 1; string claim_name = 2; string claim_namespace = 3; repeated ClaimResource claim_resources = 4; } // ClaimResource contains resource information. The driver name/pool name/device name // triplet uniquely identifies the device. Should DRA get extended to other kinds // of resources, then device_name will be empty and other fields will get added. // Each device at the DRA API level may map to zero or more CDI devices. message ClaimResource { repeated CDIDevice cdi_devices = 1 [(gogoproto.customname) = "CDIDevices"]; string driver_name = 2; string pool_name = 3; string device_name = 4; } // CDIDevice specifies a CDI device information message CDIDevice { // Fully qualified CDI device name // for example: vendor.com/gpu=gpudevice1 // see more details in the CDI specification: // https://github.com/container-orchestrated-devices/container-device-interface/blob/main/SPEC.md string name = 1; } // GetPodResourcesRequest contains information about the pod message GetPodResourcesRequest { string pod_name = 1; string pod_namespace = 2; } // GetPodResourcesResponse contains information about the pod the devices message GetPodResourcesResponse { PodResources pod_resources = 1; } kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1alpha1/000077500000000000000000000000001503561374700232665ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1alpha1/api.pb.go000066400000000000000000001064031503561374700247720ustar00rootroot00000000000000/* 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 protoc-gen-gogo. DO NOT EDIT. // source: api.proto package v1alpha1 import ( context "context" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // ListPodResourcesRequest is the request made to the PodResourcesLister service type ListPodResourcesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodResourcesRequest) Reset() { *m = ListPodResourcesRequest{} } func (*ListPodResourcesRequest) ProtoMessage() {} func (*ListPodResourcesRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{0} } func (m *ListPodResourcesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodResourcesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodResourcesRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodResourcesRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodResourcesRequest.Merge(m, src) } func (m *ListPodResourcesRequest) XXX_Size() int { return m.Size() } func (m *ListPodResourcesRequest) XXX_DiscardUnknown() { xxx_messageInfo_ListPodResourcesRequest.DiscardUnknown(m) } var xxx_messageInfo_ListPodResourcesRequest proto.InternalMessageInfo // ListPodResourcesResponse is the response returned by List function type ListPodResourcesResponse struct { PodResources []*PodResources `protobuf:"bytes,1,rep,name=pod_resources,json=podResources,proto3" json:"pod_resources,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ListPodResourcesResponse) Reset() { *m = ListPodResourcesResponse{} } func (*ListPodResourcesResponse) ProtoMessage() {} func (*ListPodResourcesResponse) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{1} } func (m *ListPodResourcesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ListPodResourcesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListPodResourcesResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ListPodResourcesResponse) XXX_Merge(src proto.Message) { xxx_messageInfo_ListPodResourcesResponse.Merge(m, src) } func (m *ListPodResourcesResponse) XXX_Size() int { return m.Size() } func (m *ListPodResourcesResponse) XXX_DiscardUnknown() { xxx_messageInfo_ListPodResourcesResponse.DiscardUnknown(m) } var xxx_messageInfo_ListPodResourcesResponse proto.InternalMessageInfo func (m *ListPodResourcesResponse) GetPodResources() []*PodResources { if m != nil { return m.PodResources } return nil } // PodResources contains information about the node resources assigned to a pod type PodResources struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Containers []*ContainerResources `protobuf:"bytes,3,rep,name=containers,proto3" json:"containers,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *PodResources) Reset() { *m = PodResources{} } func (*PodResources) ProtoMessage() {} func (*PodResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{2} } func (m *PodResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *PodResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_PodResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *PodResources) XXX_Merge(src proto.Message) { xxx_messageInfo_PodResources.Merge(m, src) } func (m *PodResources) XXX_Size() int { return m.Size() } func (m *PodResources) XXX_DiscardUnknown() { xxx_messageInfo_PodResources.DiscardUnknown(m) } var xxx_messageInfo_PodResources proto.InternalMessageInfo func (m *PodResources) GetName() string { if m != nil { return m.Name } return "" } func (m *PodResources) GetNamespace() string { if m != nil { return m.Namespace } return "" } func (m *PodResources) GetContainers() []*ContainerResources { if m != nil { return m.Containers } return nil } // ContainerResources contains information about the resources assigned to a container type ContainerResources struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Devices []*ContainerDevices `protobuf:"bytes,2,rep,name=devices,proto3" json:"devices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerResources) Reset() { *m = ContainerResources{} } func (*ContainerResources) ProtoMessage() {} func (*ContainerResources) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{3} } func (m *ContainerResources) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerResources.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerResources) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerResources.Merge(m, src) } func (m *ContainerResources) XXX_Size() int { return m.Size() } func (m *ContainerResources) XXX_DiscardUnknown() { xxx_messageInfo_ContainerResources.DiscardUnknown(m) } var xxx_messageInfo_ContainerResources proto.InternalMessageInfo func (m *ContainerResources) GetName() string { if m != nil { return m.Name } return "" } func (m *ContainerResources) GetDevices() []*ContainerDevices { if m != nil { return m.Devices } return nil } // ContainerDevices contains information about the devices assigned to a container type ContainerDevices struct { ResourceName string `protobuf:"bytes,1,opt,name=resource_name,json=resourceName,proto3" json:"resource_name,omitempty"` DeviceIds []string `protobuf:"bytes,2,rep,name=device_ids,json=deviceIds,proto3" json:"device_ids,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_sizecache int32 `json:"-"` } func (m *ContainerDevices) Reset() { *m = ContainerDevices{} } func (*ContainerDevices) ProtoMessage() {} func (*ContainerDevices) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{4} } func (m *ContainerDevices) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *ContainerDevices) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ContainerDevices.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *ContainerDevices) XXX_Merge(src proto.Message) { xxx_messageInfo_ContainerDevices.Merge(m, src) } func (m *ContainerDevices) XXX_Size() int { return m.Size() } func (m *ContainerDevices) XXX_DiscardUnknown() { xxx_messageInfo_ContainerDevices.DiscardUnknown(m) } var xxx_messageInfo_ContainerDevices proto.InternalMessageInfo func (m *ContainerDevices) GetResourceName() string { if m != nil { return m.ResourceName } return "" } func (m *ContainerDevices) GetDeviceIds() []string { if m != nil { return m.DeviceIds } return nil } func init() { proto.RegisterType((*ListPodResourcesRequest)(nil), "v1alpha1.ListPodResourcesRequest") proto.RegisterType((*ListPodResourcesResponse)(nil), "v1alpha1.ListPodResourcesResponse") proto.RegisterType((*PodResources)(nil), "v1alpha1.PodResources") proto.RegisterType((*ContainerResources)(nil), "v1alpha1.ContainerResources") proto.RegisterType((*ContainerDevices)(nil), "v1alpha1.ContainerDevices") } func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ // 377 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x3f, 0x4f, 0xf3, 0x30, 0x10, 0xc6, 0xeb, 0xb6, 0x7a, 0xdf, 0x37, 0xf7, 0xb6, 0x12, 0xf2, 0x00, 0xa1, 0x2a, 0x51, 0x09, 0x4b, 0x97, 0x26, 0x6a, 0x61, 0x40, 0x82, 0x09, 0x58, 0x10, 0x08, 0x50, 0x06, 0x90, 0x18, 0xa8, 0xf2, 0xc7, 0xa4, 0x56, 0xdb, 0xd8, 0xc4, 0x49, 0x47, 0xc4, 0x47, 0xe0, 0x63, 0x75, 0x64, 0x64, 0xa4, 0xe1, 0x8b, 0xa0, 0x38, 0x0a, 0x09, 0xb4, 0x30, 0xe5, 0xee, 0x9e, 0xc7, 0xf9, 0x9d, 0x7d, 0x07, 0x8a, 0xcd, 0xa9, 0xc1, 0x43, 0x16, 0x31, 0xfc, 0x6f, 0xd6, 0xb7, 0x27, 0x7c, 0x64, 0xf7, 0x5b, 0x3d, 0x9f, 0x46, 0xa3, 0xd8, 0x31, 0x5c, 0x36, 0x35, 0x7d, 0xe6, 0x33, 0x53, 0x1a, 0x9c, 0xf8, 0x5e, 0x66, 0x32, 0x91, 0x51, 0x76, 0x50, 0xdf, 0x84, 0x8d, 0x73, 0x2a, 0xa2, 0x2b, 0xe6, 0x59, 0x44, 0xb0, 0x38, 0x74, 0x89, 0xb0, 0xc8, 0x43, 0x4c, 0x44, 0xa4, 0xdf, 0x80, 0xba, 0x2c, 0x09, 0xce, 0x02, 0x41, 0xf0, 0x01, 0x34, 0x39, 0xf3, 0x86, 0x61, 0x2e, 0xa8, 0xa8, 0x53, 0xeb, 0xfe, 0x1f, 0xac, 0x1b, 0x79, 0x1f, 0xc6, 0x97, 0x63, 0x0d, 0x5e, 0xca, 0xf4, 0x47, 0x68, 0x94, 0x55, 0x8c, 0xa1, 0x1e, 0xd8, 0x53, 0xa2, 0xa2, 0x0e, 0xea, 0x2a, 0x96, 0x8c, 0x71, 0x1b, 0x94, 0xf4, 0x2b, 0xb8, 0xed, 0x12, 0xb5, 0x2a, 0x85, 0xa2, 0x80, 0x0f, 0x01, 0x5c, 0x16, 0x44, 0x36, 0x0d, 0x48, 0x28, 0xd4, 0x9a, 0x64, 0xb7, 0x0b, 0xf6, 0x71, 0xae, 0x15, 0x1d, 0x94, 0xfc, 0xfa, 0x1d, 0xe0, 0x65, 0xc7, 0xca, 0x2e, 0xf6, 0xe0, 0xaf, 0x47, 0x66, 0x34, 0xbd, 0x60, 0x55, 0x42, 0x5a, 0x2b, 0x20, 0x27, 0x99, 0xc3, 0xca, 0xad, 0xfa, 0x35, 0xac, 0x7d, 0x17, 0xf1, 0x0e, 0x34, 0xf3, 0xc7, 0x1a, 0x96, 0x30, 0x8d, 0xbc, 0x78, 0x91, 0xe2, 0xb6, 0x00, 0xb2, 0x7f, 0x0c, 0xa9, 0x97, 0x11, 0x15, 0x4b, 0xc9, 0x2a, 0xa7, 0x9e, 0x18, 0x10, 0xc0, 0xe5, 0x77, 0x4b, 0x87, 0x43, 0x42, 0x7c, 0x09, 0xf5, 0x34, 0xc2, 0xdb, 0x45, 0x6b, 0x3f, 0x4c, 0xb4, 0xa5, 0xff, 0x66, 0xc9, 0x26, 0xab, 0x57, 0x8e, 0xce, 0xe6, 0x0b, 0x0d, 0xbd, 0x2e, 0xb4, 0xca, 0x53, 0xa2, 0xa1, 0x79, 0xa2, 0xa1, 0x97, 0x44, 0x43, 0x6f, 0x89, 0x86, 0x9e, 0xdf, 0xb5, 0xca, 0x6d, 0x6f, 0xbc, 0x2f, 0x0c, 0xca, 0xcc, 0x71, 0xec, 0x90, 0x09, 0x89, 0x4c, 0x3e, 0xf6, 0x4d, 0x9b, 0x53, 0x61, 0x72, 0xe6, 0x7d, 0xae, 0x83, 0x99, 0x73, 0x9c, 0x3f, 0x72, 0xcd, 0x76, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xe5, 0x34, 0x76, 0xac, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 // PodResourcesListerClient is the client API for PodResourcesLister service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type PodResourcesListerClient interface { List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) } type podResourcesListerClient struct { cc *grpc.ClientConn } func NewPodResourcesListerClient(cc *grpc.ClientConn) PodResourcesListerClient { return &podResourcesListerClient{cc} } func (c *podResourcesListerClient) List(ctx context.Context, in *ListPodResourcesRequest, opts ...grpc.CallOption) (*ListPodResourcesResponse, error) { out := new(ListPodResourcesResponse) err := c.cc.Invoke(ctx, "/v1alpha1.PodResourcesLister/List", in, out, opts...) if err != nil { return nil, err } return out, nil } // PodResourcesListerServer is the server API for PodResourcesLister service. type PodResourcesListerServer interface { List(context.Context, *ListPodResourcesRequest) (*ListPodResourcesResponse, error) } // UnimplementedPodResourcesListerServer can be embedded to have forward compatible implementations. type UnimplementedPodResourcesListerServer struct { } func (*UnimplementedPodResourcesListerServer) List(ctx context.Context, req *ListPodResourcesRequest) (*ListPodResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method List not implemented") } func RegisterPodResourcesListerServer(s *grpc.Server, srv PodResourcesListerServer) { 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: "/v1alpha1.PodResourcesLister/List", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PodResourcesListerServer).List(ctx, req.(*ListPodResourcesRequest)) } return interceptor(ctx, in, info, handler) } var _PodResourcesLister_serviceDesc = grpc.ServiceDesc{ ServiceName: "v1alpha1.PodResourcesLister", HandlerType: (*PodResourcesListerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "List", Handler: _PodResourcesLister_List_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api.proto", } func (m *ListPodResourcesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodResourcesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodResourcesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l return len(dAtA) - i, nil } func (m *ListPodResourcesResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ListPodResourcesResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ListPodResourcesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.PodResources) > 0 { for iNdEx := len(m.PodResources) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.PodResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0xa } } return len(dAtA) - i, nil } func (m *PodResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *PodResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *PodResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Containers) > 0 { for iNdEx := len(m.Containers) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Containers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if len(m.Namespace) > 0 { i -= len(m.Namespace) copy(dAtA[i:], m.Namespace) i = encodeVarintApi(dAtA, i, uint64(len(m.Namespace))) i-- dAtA[i] = 0x12 } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerResources) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerResources) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerResources) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Devices) > 0 { for iNdEx := len(m.Devices) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Devices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintApi(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x12 } } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintApi(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func (m *ContainerDevices) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *ContainerDevices) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *ContainerDevices) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.DeviceIds) > 0 { for iNdEx := len(m.DeviceIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.DeviceIds[iNdEx]) copy(dAtA[i:], m.DeviceIds[iNdEx]) i = encodeVarintApi(dAtA, i, uint64(len(m.DeviceIds[iNdEx]))) i-- dAtA[i] = 0x12 } } if len(m.ResourceName) > 0 { i -= len(m.ResourceName) copy(dAtA[i:], m.ResourceName) i = encodeVarintApi(dAtA, i, uint64(len(m.ResourceName))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintApi(dAtA []byte, offset int, v uint64) int { offset -= sovApi(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *ListPodResourcesRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l return n } func (m *ListPodResourcesResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l if len(m.PodResources) > 0 { for _, e := range m.PodResources { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *PodResources) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } l = len(m.Namespace) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Containers) > 0 { for _, e := range m.Containers { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerResources) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.Name) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.Devices) > 0 { for _, e := range m.Devices { l = e.Size() n += 1 + l + sovApi(uint64(l)) } } return n } func (m *ContainerDevices) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.ResourceName) if l > 0 { n += 1 + l + sovApi(uint64(l)) } if len(m.DeviceIds) > 0 { for _, s := range m.DeviceIds { l = len(s) n += 1 + l + sovApi(uint64(l)) } } return n } func sovApi(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozApi(x uint64) (n int) { return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *ListPodResourcesRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ListPodResourcesRequest{`, `}`, }, "") return s } func (this *ListPodResourcesResponse) String() string { if this == nil { return "nil" } repeatedStringForPodResources := "[]*PodResources{" for _, f := range this.PodResources { repeatedStringForPodResources += strings.Replace(f.String(), "PodResources", "PodResources", 1) + "," } repeatedStringForPodResources += "}" s := strings.Join([]string{`&ListPodResourcesResponse{`, `PodResources:` + repeatedStringForPodResources + `,`, `}`, }, "") return s } func (this *PodResources) String() string { if this == nil { return "nil" } repeatedStringForContainers := "[]*ContainerResources{" for _, f := range this.Containers { repeatedStringForContainers += strings.Replace(f.String(), "ContainerResources", "ContainerResources", 1) + "," } repeatedStringForContainers += "}" s := strings.Join([]string{`&PodResources{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `Containers:` + repeatedStringForContainers + `,`, `}`, }, "") return s } func (this *ContainerResources) String() string { if this == nil { return "nil" } repeatedStringForDevices := "[]*ContainerDevices{" for _, f := range this.Devices { repeatedStringForDevices += strings.Replace(f.String(), "ContainerDevices", "ContainerDevices", 1) + "," } repeatedStringForDevices += "}" s := strings.Join([]string{`&ContainerResources{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Devices:` + repeatedStringForDevices + `,`, `}`, }, "") return s } func (this *ContainerDevices) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&ContainerDevices{`, `ResourceName:` + fmt.Sprintf("%v", this.ResourceName) + `,`, `DeviceIds:` + fmt.Sprintf("%v", this.DeviceIds) + `,`, `}`, }, "") return s } func valueToStringApi(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *ListPodResourcesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodResourcesRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodResourcesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ListPodResourcesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ListPodResourcesResponse: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ListPodResourcesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PodResources", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.PodResources = append(m.PodResources, &PodResources{}) if err := m.PodResources[len(m.PodResources)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *PodResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: PodResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: PodResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Namespace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Containers", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Containers = append(m.Containers, &ContainerResources{}) if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerResources) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerResources: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerResources: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Devices", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.Devices = append(m.Devices, &ContainerDevices{}) if err := m.Devices[len(m.Devices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ContainerDevices) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ContainerDevices: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ContainerDevices: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ResourceName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.ResourceName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DeviceIds", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthApi } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthApi } if postIndex > l { return io.ErrUnexpectedEOF } m.DeviceIds = append(m.DeviceIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthApi } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipApi(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowApi } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthApi } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupApi } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthApi } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group") ) kubelet-kubernetes-1.32.7/pkg/apis/podresources/v1alpha1/api.proto000066400000000000000000000031551503561374700251300ustar00rootroot00000000000000// To regenerate api.pb.go run `hack/update-codegen.sh protobindings` syntax = "proto3"; package v1alpha1; option go_package = "k8s.io/kubelet/pkg/apis/podresources/v1alpha1"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.stringer_all) = true; option (gogoproto.goproto_getters_all) = true; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; option (gogoproto.unmarshaler_all) = true; option (gogoproto.goproto_unrecognized_all) = false; // PodResourcesLister is a service provided by the kubelet that provides information about the // node resources consumed by pods and containers on the node service PodResourcesLister { rpc List(ListPodResourcesRequest) returns (ListPodResourcesResponse) {} } // ListPodResourcesRequest is the request made to the PodResourcesLister service message ListPodResourcesRequest {} // ListPodResourcesResponse is the response returned by List function message ListPodResourcesResponse { repeated PodResources pod_resources = 1; } // PodResources contains information about the node resources assigned to a pod message PodResources { string name = 1; string namespace = 2; repeated ContainerResources containers = 3; } // ContainerResources contains information about the resources assigned to a container message ContainerResources { string name = 1; repeated ContainerDevices devices = 2; } // ContainerDevices contains information about the devices assigned to a container message ContainerDevices { string resource_name = 1; repeated string device_ids = 2; } kubelet-kubernetes-1.32.7/pkg/apis/stats/000077500000000000000000000000001503561374700202725ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/stats/v1alpha1/000077500000000000000000000000001503561374700217075ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/apis/stats/v1alpha1/types.go000066400000000000000000000360361503561374700234120ustar00rootroot00000000000000/* Copyright 2015 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 v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Summary is a top-level container for holding NodeStats and PodStats. type Summary struct { // Overall node stats. Node NodeStats `json:"node"` // Per-pod stats. Pods []PodStats `json:"pods"` } // NodeStats holds node-level unprocessed sample stats. type NodeStats struct { // Reference to the measured Node. NodeName string `json:"nodeName"` // Stats of system daemons tracked as raw containers. // The system containers are named according to the SystemContainer* constants. // +optional // +patchMergeKey=name // +patchStrategy=merge SystemContainers []ContainerStats `json:"systemContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name"` // The time at which data collection for the node-scoped (i.e. aggregate) stats was (re)started. StartTime metav1.Time `json:"startTime"` // Stats pertaining to CPU resources. // +optional CPU *CPUStats `json:"cpu,omitempty"` // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` // Stats pertaining to total usage of filesystem resources on the rootfs used by node k8s components. // NodeFs.Used is the total bytes used on the filesystem. // +optional Fs *FsStats `json:"fs,omitempty"` // Stats about the underlying container runtime. // +optional Runtime *RuntimeStats `json:"runtime,omitempty"` // Stats about the rlimit of system. // +optional Rlimit *RlimitStats `json:"rlimit,omitempty"` // Stats pertaining to swap resources. This is reported to non-windows systems only. // +optional Swap *SwapStats `json:"swap,omitempty"` } // RlimitStats are stats rlimit of OS. type RlimitStats struct { Time metav1.Time `json:"time"` // The max number of extant process (threads, precisely on Linux) of OS. See RLIMIT_NPROC in getrlimit(2). // The operating system ceiling on the number of process IDs that can be assigned. // On Linux, tasks (either processes or threads) consume 1 PID each. MaxPID *int64 `json:"maxpid,omitempty"` // The number of running process (threads, precisely on Linux) in the OS. NumOfRunningProcesses *int64 `json:"curproc,omitempty"` } // RuntimeStats are stats pertaining to the underlying container runtime. type RuntimeStats struct { // Stats about the underlying filesystem where container images are stored. // This filesystem could be the same as the primary (root) filesystem. // Usage here refers to the total number of bytes occupied by images on the filesystem. // +optional ImageFs *FsStats `json:"imageFs,omitempty"` // Stats about the underlying filesystem where container's writeable layer is stored. // This filesystem could be the same as the primary (root) filesystem or the ImageFS. // Usage here refers to the total number of bytes occupied by the writeable layer on the filesystem. // +optional ContainerFs *FsStats `json:"containerFs,omitempty"` } const ( // SystemContainerKubelet is the container name for the system container tracking Kubelet usage. SystemContainerKubelet = "kubelet" // SystemContainerRuntime is the container name for the system container tracking the runtime (e.g. docker) usage. SystemContainerRuntime = "runtime" // SystemContainerMisc is the container name for the system container tracking non-kubernetes processes. SystemContainerMisc = "misc" // SystemContainerPods is the container name for the system container tracking user pods. SystemContainerPods = "pods" // SystemContainerWindowsGlobalCommitMemory (only used on Windows) is the container name for the system container // tracking global commit memory usage and is used for memory-pressure eviction. SystemContainerWindowsGlobalCommitMemory = "windows-global-commit-memory" ) // ProcessStats are stats pertaining to processes. type ProcessStats struct { // Number of processes // +optional ProcessCount *uint64 `json:"process_count,omitempty"` } // PodStats holds pod-level unprocessed sample stats. type PodStats struct { // Reference to the measured Pod. PodRef PodReference `json:"podRef"` // The time at which data collection for the pod-scoped (e.g. network) stats was (re)started. StartTime metav1.Time `json:"startTime"` // Stats of containers in the measured pod. // +patchMergeKey=name // +patchStrategy=merge Containers []ContainerStats `json:"containers" patchStrategy:"merge" patchMergeKey:"name"` // Stats pertaining to CPU resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). // +optional CPU *CPUStats `json:"cpu,omitempty"` // Stats pertaining to memory (RAM) resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). // +optional Memory *MemoryStats `json:"memory,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` // Stats pertaining to volume usage of filesystem resources. // VolumeStats.UsedBytes is the number of bytes used by the Volume // +optional // +patchMergeKey=name // +patchStrategy=merge VolumeStats []VolumeStats `json:"volume,omitempty" patchStrategy:"merge" patchMergeKey:"name"` // EphemeralStorage reports the total filesystem usage for the containers and emptyDir-backed volumes in the measured Pod. // +optional EphemeralStorage *FsStats `json:"ephemeral-storage,omitempty"` // ProcessStats pertaining to processes. // +optional ProcessStats *ProcessStats `json:"process_stats,omitempty"` // Stats pertaining to swap resources. This is reported to non-windows systems only. // +optional Swap *SwapStats `json:"swap,omitempty"` } // ContainerStats holds container-level unprocessed sample stats. type ContainerStats struct { // Reference to the measured container. Name string `json:"name"` // The time at which data collection for this container was (re)started. StartTime metav1.Time `json:"startTime"` // Stats pertaining to CPU resources. // +optional CPU *CPUStats `json:"cpu,omitempty"` // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` // Metrics for Accelerators. Each Accelerator corresponds to one element in the array. Accelerators []AcceleratorStats `json:"accelerators,omitempty"` // Stats pertaining to container rootfs usage of filesystem resources. // Rootfs.UsedBytes is the number of bytes used for the container write layer. // +optional Rootfs *FsStats `json:"rootfs,omitempty"` // Stats pertaining to container logs usage of filesystem resources. // Logs.UsedBytes is the number of bytes used for the container logs. // +optional Logs *FsStats `json:"logs,omitempty"` // User defined metrics that are exposed by containers in the pod. Typically, we expect only one container in the pod to be exposing user defined metrics. In the event of multiple containers exposing metrics, they will be combined here. // +patchMergeKey=name // +patchStrategy=merge UserDefinedMetrics []UserDefinedMetric `json:"userDefinedMetrics,omitempty" patchStrategy:"merge" patchMergeKey:"name"` // Stats pertaining to swap resources. This is reported to non-windows systems only. // +optional Swap *SwapStats `json:"swap,omitempty"` } // PodReference contains enough information to locate the referenced pod. type PodReference struct { Name string `json:"name"` Namespace string `json:"namespace"` UID string `json:"uid"` } // InterfaceStats contains resource value data about interface. type InterfaceStats struct { // The name of the interface Name string `json:"name"` // Cumulative count of bytes received. // +optional RxBytes *uint64 `json:"rxBytes,omitempty"` // Cumulative count of receive errors encountered. // +optional RxErrors *uint64 `json:"rxErrors,omitempty"` // Cumulative count of bytes transmitted. // +optional TxBytes *uint64 `json:"txBytes,omitempty"` // Cumulative count of transmit errors encountered. // +optional TxErrors *uint64 `json:"txErrors,omitempty"` } // NetworkStats contains data about network resources. type NetworkStats struct { // The time at which these stats were updated. Time metav1.Time `json:"time"` // Stats for the default interface, if found InterfaceStats `json:",inline"` Interfaces []InterfaceStats `json:"interfaces,omitempty"` } // CPUStats contains data about CPU usage. type CPUStats struct { // The time at which these stats were updated. Time metav1.Time `json:"time"` // Total CPU usage (sum of all cores) averaged over the sample window. // The "core" unit can be interpreted as CPU core-nanoseconds per second. // +optional UsageNanoCores *uint64 `json:"usageNanoCores,omitempty"` // Cumulative CPU usage (sum of all cores) since object creation. // +optional UsageCoreNanoSeconds *uint64 `json:"usageCoreNanoSeconds,omitempty"` } // MemoryStats contains data about memory usage. type MemoryStats struct { // The time at which these stats were updated. Time metav1.Time `json:"time"` // Available memory for use. This is defined as the memory limit - workingSetBytes. // If memory limit is undefined, the available bytes is omitted. // +optional AvailableBytes *uint64 `json:"availableBytes,omitempty"` // Total memory in use. This includes all memory regardless of when it was accessed. // +optional UsageBytes *uint64 `json:"usageBytes,omitempty"` // The amount of working set memory. This includes recently accessed memory, // dirty memory, and kernel memory. WorkingSetBytes is <= UsageBytes // +optional WorkingSetBytes *uint64 `json:"workingSetBytes,omitempty"` // The amount of anonymous and swap cache memory (includes transparent // hugepages). // +optional RSSBytes *uint64 `json:"rssBytes,omitempty"` // Cumulative number of minor page faults. // +optional PageFaults *uint64 `json:"pageFaults,omitempty"` // Cumulative number of major page faults. // +optional MajorPageFaults *uint64 `json:"majorPageFaults,omitempty"` } // SwapStats contains data about memory usage type SwapStats struct { // The time at which these stats were updated. Time metav1.Time `json:"time"` // Available swap memory for use. This is defined as the - . // If swap limit is undefined, this value is omitted. // +optional SwapAvailableBytes *uint64 `json:"swapAvailableBytes,omitempty"` // Total swap memory in use. // +optional SwapUsageBytes *uint64 `json:"swapUsageBytes,omitempty"` } // AcceleratorStats contains stats for accelerators attached to the container. type AcceleratorStats struct { // Make of the accelerator (nvidia, amd, google etc.) Make string `json:"make"` // Model of the accelerator (tesla-p100, tesla-k80 etc.) Model string `json:"model"` // ID of the accelerator. ID string `json:"id"` // Total accelerator memory. // unit: bytes MemoryTotal uint64 `json:"memoryTotal"` // Total accelerator memory allocated. // unit: bytes MemoryUsed uint64 `json:"memoryUsed"` // Percent of time over the past sample period (10s) during which // the accelerator was actively processing. DutyCycle uint64 `json:"dutyCycle"` } // VolumeStats contains data about Volume filesystem usage. type VolumeStats struct { // Embedded FsStats FsStats `json:",inline"` // Name is the name given to the Volume // +optional Name string `json:"name,omitempty"` // Reference to the PVC, if one exists // +optional PVCRef *PVCReference `json:"pvcRef,omitempty"` // VolumeHealthStats contains data about volume health // +optional VolumeHealthStats *VolumeHealthStats `json:"volumeHealthStats,omitempty"` } // VolumeHealthStats contains data about volume health. type VolumeHealthStats struct { // Normal volumes are available for use and operating optimally. // An abnormal volume does not meet these criteria. Abnormal bool `json:"abnormal"` } // PVCReference contains enough information to describe the referenced PVC. type PVCReference struct { Name string `json:"name"` Namespace string `json:"namespace"` } // FsStats contains data about filesystem usage. type FsStats struct { // The time at which these stats were updated. Time metav1.Time `json:"time"` // AvailableBytes represents the storage space available (bytes) for the filesystem. // +optional AvailableBytes *uint64 `json:"availableBytes,omitempty"` // CapacityBytes represents the total capacity (bytes) of the filesystems underlying storage. // +optional CapacityBytes *uint64 `json:"capacityBytes,omitempty"` // UsedBytes represents the bytes used for a specific task on the filesystem. // This may differ from the total bytes used on the filesystem and may not equal CapacityBytes - AvailableBytes. // e.g. For ContainerStats.Rootfs this is the bytes used by the container rootfs on the filesystem. // +optional UsedBytes *uint64 `json:"usedBytes,omitempty"` // InodesFree represents the free inodes in the filesystem. // +optional InodesFree *uint64 `json:"inodesFree,omitempty"` // Inodes represents the total inodes in the filesystem. // +optional Inodes *uint64 `json:"inodes,omitempty"` // InodesUsed represents the inodes used by the filesystem // This may not equal Inodes - InodesFree because this filesystem may share inodes with other "filesystems" // e.g. For ContainerStats.Rootfs, this is the inodes used only by that container, and does not count inodes used by other containers. InodesUsed *uint64 `json:"inodesUsed,omitempty"` } // UserDefinedMetricType defines how the metric should be interpreted by the user. type UserDefinedMetricType string const ( // MetricGauge is an instantaneous value. May increase or decrease. MetricGauge UserDefinedMetricType = "gauge" // MetricCumulative is a counter-like value that is only expected to increase. MetricCumulative UserDefinedMetricType = "cumulative" // MetricDelta is a rate over a time period. MetricDelta UserDefinedMetricType = "delta" ) // UserDefinedMetricDescriptor contains metadata that describes a user defined metric. type UserDefinedMetricDescriptor struct { // The name of the metric. Name string `json:"name"` // Type of the metric. Type UserDefinedMetricType `json:"type"` // Display Units for the stats. Units string `json:"units"` // Metadata labels associated with this metric. // +optional Labels map[string]string `json:"labels,omitempty"` } // UserDefinedMetric represents a metric defined and generated by users. type UserDefinedMetric struct { UserDefinedMetricDescriptor `json:",inline"` // The time at which these stats were updated. Time metav1.Time `json:"time"` // Value of the metric. Float64s have 53 bit precision. // We do not foresee any metrics exceeding that value. Value float64 `json:"value"` } kubelet-kubernetes-1.32.7/pkg/apis/well_known_labels.go000066400000000000000000000050461503561374700231710ustar00rootroot00000000000000/* Copyright 2015 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 apis import ( "strings" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" ) const ( // LabelOS is a label to indicate the operating system of the node. // The OS labels are promoted to GA in 1.14. kubelet applies GA labels and stop applying the beta OS labels in Kubernetes 1.19. LabelOS = "beta.kubernetes.io/os" // LabelArch is a label to indicate the architecture of the node. // The Arch labels are promoted to GA in 1.14. kubelet applies GA labels and stop applying the beta Arch labels in Kubernetes 1.19. LabelArch = "beta.kubernetes.io/arch" ) var kubeletLabels = sets.NewString( v1.LabelHostname, v1.LabelTopologyZone, v1.LabelTopologyRegion, v1.LabelFailureDomainBetaZone, v1.LabelFailureDomainBetaRegion, v1.LabelInstanceType, v1.LabelInstanceTypeStable, v1.LabelOSStable, v1.LabelArchStable, LabelOS, LabelArch, ) var kubeletLabelNamespaces = sets.NewString( v1.LabelNamespaceSuffixKubelet, v1.LabelNamespaceSuffixNode, ) // KubeletLabels returns the list of label keys kubelets are allowed to set on their own Node objects func KubeletLabels() []string { return kubeletLabels.List() } // KubeletLabelNamespaces returns the list of label key namespaces kubelets are allowed to set on their own Node objects func KubeletLabelNamespaces() []string { return kubeletLabelNamespaces.List() } // IsKubeletLabel returns true if the label key is one that kubelets are allowed to set on their own Node object. // This checks if the key is in the KubeletLabels() list, or has a namespace in the KubeletLabelNamespaces() list. func IsKubeletLabel(key string) bool { if kubeletLabels.Has(key) { return true } namespace := getLabelNamespace(key) for allowedNamespace := range kubeletLabelNamespaces { if namespace == allowedNamespace || strings.HasSuffix(namespace, "."+allowedNamespace) { return true } } return false } func getLabelNamespace(key string) string { if parts := strings.SplitN(key, "/", 2); len(parts) == 2 { return parts[0] } return "" } kubelet-kubernetes-1.32.7/pkg/cri/000077500000000000000000000000001503561374700167555ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/cri/streaming/000077500000000000000000000000001503561374700207465ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/cri/streaming/.import-restrictions000066400000000000000000000002461503561374700250110ustar00rootroot00000000000000rules: # prevent exposing internal api in streaming packages - selectorRegexp: k8s[.]io/kubernetes allowedPrefixes: - k8s.io/kubernetes/pkg/kubelet/cri kubelet-kubernetes-1.32.7/pkg/cri/streaming/errors.go000066400000000000000000000032721503561374700226150ustar00rootroot00000000000000/* Copyright 2016 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 streaming import ( "net/http" "strconv" "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" ) // NewErrorTooManyInFlight creates an error for exceeding the maximum number of in-flight requests. func NewErrorTooManyInFlight() error { return grpcstatus.Error(codes.ResourceExhausted, "maximum number of in-flight requests exceeded") } // WriteError translates a CRI streaming error into an appropriate HTTP response. func WriteError(err error, w http.ResponseWriter) error { s, _ := grpcstatus.FromError(err) var status int switch s.Code() { case codes.NotFound: status = http.StatusNotFound case codes.ResourceExhausted: // We only expect to hit this if there is a DoS, so we just wait the full TTL. // If this is ever hit in steady-state operations, consider increasing the maxInFlight requests, // or plumbing through the time to next expiration. w.Header().Set("Retry-After", strconv.Itoa(int(cacheTTL.Seconds()))) status = http.StatusTooManyRequests default: status = http.StatusInternalServerError } w.WriteHeader(status) _, writeErr := w.Write([]byte(err.Error())) return writeErr } kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/000077500000000000000000000000001503561374700233175ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/constants.go000066400000000000000000000016261503561374700256670ustar00rootroot00000000000000/* Copyright 2015 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 portforward contains server-side logic for handling port forwarding requests. package portforward // ProtocolV1Name is the name of the subprotocol used for port forwarding. const ProtocolV1Name = "portforward.k8s.io" // SupportedProtocols are the supported port forwarding protocols. var SupportedProtocols = []string{ProtocolV1Name} kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/httpstream.go000066400000000000000000000265501503561374700260510ustar00rootroot00000000000000/* Copyright 2016 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 portforward import ( "context" "errors" "fmt" "net/http" "strconv" "sync" "time" api "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/klog/v2" ) func handleHTTPStreams(req *http.Request, w http.ResponseWriter, portForwarder PortForwarder, podName string, uid types.UID, supportedPortForwardProtocols []string, idleTimeout, streamCreationTimeout time.Duration) error { _, err := httpstream.Handshake(req, w, supportedPortForwardProtocols) // negotiated protocol isn't currently used server side, but could be in the future if err != nil { // Handshake writes the error to the client return err } streamChan := make(chan httpstream.Stream, 1) klog.V(5).InfoS("Upgrading port forward response") upgrader := spdy.NewResponseUpgrader() conn := upgrader.UpgradeResponse(w, req, httpStreamReceived(streamChan)) if conn == nil { return errors.New("unable to upgrade httpstream connection") } defer conn.Close() klog.V(5).InfoS("Connection setting port forwarding streaming connection idle timeout", "connection", conn, "idleTimeout", idleTimeout) conn.SetIdleTimeout(idleTimeout) h := &httpStreamHandler{ conn: conn, streamChan: streamChan, streamPairs: make(map[string]*httpStreamPair), streamCreationTimeout: streamCreationTimeout, pod: podName, uid: uid, forwarder: portForwarder, } h.run() return nil } // httpStreamReceived is the httpstream.NewStreamHandler for port // forward streams. It checks each stream's port and stream type headers, // rejecting any streams that with missing or invalid values. Each valid // stream is sent to the streams channel. func httpStreamReceived(streams chan httpstream.Stream) func(httpstream.Stream, <-chan struct{}) error { return func(stream httpstream.Stream, replySent <-chan struct{}) error { // make sure it has a valid port header portString := stream.Headers().Get(api.PortHeader) if len(portString) == 0 { return fmt.Errorf("%q header is required", api.PortHeader) } port, err := strconv.ParseUint(portString, 10, 16) if err != nil { return fmt.Errorf("unable to parse %q as a port: %v", portString, err) } if port < 1 { return fmt.Errorf("port %q must be > 0", portString) } // make sure it has a valid stream type header streamType := stream.Headers().Get(api.StreamType) if len(streamType) == 0 { return fmt.Errorf("%q header is required", api.StreamType) } if streamType != api.StreamTypeError && streamType != api.StreamTypeData { return fmt.Errorf("invalid stream type %q", streamType) } streams <- stream return nil } } // httpStreamHandler is capable of processing multiple port forward // requests over a single httpstream.Connection. type httpStreamHandler struct { conn httpstream.Connection streamChan chan httpstream.Stream streamPairsLock sync.RWMutex streamPairs map[string]*httpStreamPair streamCreationTimeout time.Duration pod string uid types.UID forwarder PortForwarder } // getStreamPair returns a httpStreamPair for requestID. This creates a // new pair if one does not yet exist for the requestID. The returned bool is // true if the pair was created. func (h *httpStreamHandler) getStreamPair(requestID string) (*httpStreamPair, bool) { h.streamPairsLock.Lock() defer h.streamPairsLock.Unlock() if p, ok := h.streamPairs[requestID]; ok { klog.V(5).InfoS("Connection request found existing stream pair", "connection", h.conn, "request", requestID) return p, false } klog.V(5).InfoS("Connection request creating new stream pair", "connection", h.conn, "request", requestID) p := newPortForwardPair(requestID) h.streamPairs[requestID] = p return p, true } // monitorStreamPair waits for the pair to receive both its error and data // streams, or for the timeout to expire (whichever happens first), and then // removes the pair. 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) utilruntime.HandleError(err) p.printError(err.Error()) case <-p.complete: klog.V(5).InfoS("Connection request successfully received error and data streams", "connection", h.conn, "request", p.requestID) } h.removeStreamPair(p.requestID) } // hasStreamPair returns a bool indicating if a stream pair for requestID // exists. func (h *httpStreamHandler) hasStreamPair(requestID string) bool { h.streamPairsLock.RLock() defer h.streamPairsLock.RUnlock() _, ok := h.streamPairs[requestID] return ok } // removeStreamPair removes the stream pair identified by requestID from streamPairs. func (h *httpStreamHandler) removeStreamPair(requestID string) { h.streamPairsLock.Lock() defer h.streamPairsLock.Unlock() if h.conn != nil { pair := h.streamPairs[requestID] h.conn.RemoveStreams(pair.dataStream, pair.errorStream) } delete(h.streamPairs, requestID) } // requestID returns the request id for stream. func (h *httpStreamHandler) requestID(stream httpstream.Stream) string { requestID := stream.Headers().Get(api.PortForwardRequestIDHeader) if len(requestID) == 0 { klog.V(5).InfoS("Connection stream received without requestID header", "connection", h.conn) // If we get here, it's because the connection came from an older client // that isn't generating the request id header // (https://github.com/kubernetes/kubernetes/blob/843134885e7e0b360eb5441e85b1410a8b1a7a0c/pkg/client/unversioned/portforward/portforward.go#L258-L287) // // This is a best-effort attempt at supporting older clients. // // When there aren't concurrent new forwarded connections, each connection // will have a pair of streams (data, error), and the stream IDs will be // consecutive odd numbers, e.g. 1 and 3 for the first connection. Convert // the stream ID into a pseudo-request id by taking the stream type and // using id = stream.Identifier() when the stream type is error, // and id = stream.Identifier() - 2 when it's data. // // NOTE: this only works when there are not concurrent new streams from // multiple forwarded connections; it's a best-effort attempt at supporting // old clients that don't generate request ids. If there are concurrent // new connections, it's possible that 1 connection gets streams whose IDs // are not consecutive (e.g. 5 and 9 instead of 5 and 7). streamType := stream.Headers().Get(api.StreamType) switch streamType { case api.StreamTypeError: requestID = strconv.Itoa(int(stream.Identifier())) case api.StreamTypeData: requestID = strconv.Itoa(int(stream.Identifier()) - 2) } klog.V(5).InfoS("Connection automatically assigning request ID from stream type and stream ID", "connection", h.conn, "request", requestID, "streamType", streamType, "stream", stream.Identifier()) } return requestID } // run is the main loop for the httpStreamHandler. It processes new // streams, invoking portForward for each complete stream pair. The loop exits // when the httpstream.Connection is closed. func (h *httpStreamHandler) run() { klog.V(5).InfoS("Connection waiting for port forward streams", "connection", h.conn) Loop: for { select { case <-h.conn.CloseChan(): klog.V(5).InfoS("Connection upgraded connection closed", "connection", h.conn) break Loop case stream := <-h.streamChan: requestID := h.requestID(stream) streamType := stream.Headers().Get(api.StreamType) klog.V(5).InfoS("Connection request received new type of stream", "connection", h.conn, "request", requestID, "streamType", streamType) p, created := h.getStreamPair(requestID) if created { go h.monitorStreamPair(p, time.After(h.streamCreationTimeout)) } if complete, err := p.add(stream); err != nil { msg := fmt.Sprintf("error processing stream for request %s: %v", requestID, err) utilruntime.HandleError(errors.New(msg)) p.printError(msg) } else if complete { go h.portForward(p) } } } } // portForward invokes the httpStreamHandler's forwarder.PortForward // function for the given stream pair. func (h *httpStreamHandler) portForward(p *httpStreamPair) { ctx := context.Background() defer p.dataStream.Close() defer p.errorStream.Close() portString := p.dataStream.Headers().Get(api.PortHeader) port, _ := strconv.ParseInt(portString, 10, 32) klog.V(5).InfoS("Connection request invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) err := h.forwarder.PortForward(ctx, h.pod, h.uid, int32(port), p.dataStream) klog.V(5).InfoS("Connection request done invoking forwarder.PortForward for port", "connection", h.conn, "request", p.requestID, "port", portString) if err != nil { msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", port, h.pod, h.uid, err) utilruntime.HandleError(msg) fmt.Fprint(p.errorStream, msg.Error()) // receiving an error from a port-forward operation indicates a problem // with data stream most probably, thus we want to reset the streams // indicating there was a problem and allow a new set of streams be // created to mitigate the problem p.dataStream.Reset() // nolint:errcheck p.errorStream.Reset() // nolint:errcheck } } // httpStreamPair represents the error and data streams for a port // forwarding request. type httpStreamPair struct { lock sync.RWMutex requestID string dataStream httpstream.Stream errorStream httpstream.Stream complete chan struct{} } // newPortForwardPair creates a new httpStreamPair. func newPortForwardPair(requestID string) *httpStreamPair { return &httpStreamPair{ requestID: requestID, complete: make(chan struct{}), } } // add adds the stream to the httpStreamPair. If the pair already // contains a stream for the new stream's type, an error is returned. add // returns true if both the data and error streams for this pair have been // received. func (p *httpStreamPair) add(stream httpstream.Stream) (bool, error) { p.lock.Lock() defer p.lock.Unlock() switch stream.Headers().Get(api.StreamType) { case api.StreamTypeError: if p.errorStream != nil { return false, errors.New("error stream already assigned") } p.errorStream = stream case api.StreamTypeData: if p.dataStream != nil { return false, errors.New("data stream already assigned") } p.dataStream = stream } complete := p.errorStream != nil && p.dataStream != nil if complete { close(p.complete) } return complete, nil } // printError writes s to p.errorStream if p.errorStream has been set. func (p *httpStreamPair) printError(s string) { p.lock.RLock() defer p.lock.RUnlock() if p.errorStream != nil { fmt.Fprint(p.errorStream, s) } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/httpstream_test.go000066400000000000000000000146541503561374700271120ustar00rootroot00000000000000/* Copyright 2016 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 portforward import ( "net/http" "testing" "time" api "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/httpstream" ) func TestHTTPStreamReceived(t *testing.T) { tests := map[string]struct { port string streamType string expectedError string }{ "missing port": { expectedError: `"port" header is required`, }, "unable to parse port": { port: "abc", expectedError: `unable to parse "abc" as a port: strconv.ParseUint: parsing "abc": invalid syntax`, }, "negative port": { port: "-1", expectedError: `unable to parse "-1" as a port: strconv.ParseUint: parsing "-1": invalid syntax`, }, "missing stream type": { port: "80", expectedError: `"streamType" header is required`, }, "valid port with error stream": { port: "80", streamType: "error", }, "valid port with data stream": { port: "80", streamType: "data", }, "invalid stream type": { port: "80", streamType: "foo", expectedError: `invalid stream type "foo"`, }, } for name, test := range tests { streams := make(chan httpstream.Stream, 1) f := httpStreamReceived(streams) stream := newFakeHTTPStream() if len(test.port) > 0 { stream.headers.Set("port", test.port) } if len(test.streamType) > 0 { stream.headers.Set("streamType", test.streamType) } replySent := make(chan struct{}) err := f(stream, replySent) close(replySent) if len(test.expectedError) > 0 { if err == nil { t.Errorf("%s: expected err=%q, but it was nil", name, test.expectedError) } if e, a := test.expectedError, err.Error(); e != a { t.Errorf("%s: expected err=%q, got %q", name, e, a) } continue } if err != nil { t.Errorf("%s: unexpected error %v", name, err) continue } if s := <-streams; s != stream { t.Errorf("%s: expected stream %#v, got %#v", name, stream, s) } } } type fakeConn struct { removeStreamsCalled bool } func (*fakeConn) CreateStream(headers http.Header) (httpstream.Stream, error) { return nil, nil } func (*fakeConn) Close() error { return nil } func (*fakeConn) CloseChan() <-chan bool { return nil } func (*fakeConn) SetIdleTimeout(timeout time.Duration) {} func (f *fakeConn) RemoveStreams(streams ...httpstream.Stream) { f.removeStreamsCalled = true } func TestGetStreamPair(t *testing.T) { timeout := make(chan time.Time) conn := &fakeConn{} h := &httpStreamHandler{ streamPairs: make(map[string]*httpStreamPair), conn: conn, } // test adding a new entry p, created := h.getStreamPair("1") if p == nil { t.Fatalf("unexpected nil pair") } if !created { t.Fatal("expected created=true") } if p.dataStream != nil { t.Errorf("unexpected non-nil data stream") } if p.errorStream != nil { t.Errorf("unexpected non-nil error stream") } // start the monitor for this pair monitorDone := make(chan struct{}) go func() { h.monitorStreamPair(p, timeout) close(monitorDone) }() if !h.hasStreamPair("1") { t.Fatal("This should still be true") } // make sure we can retrieve an existing entry p2, created := h.getStreamPair("1") if created { t.Fatal("expected created=false") } if p != p2 { t.Fatalf("retrieving an existing pair: expected %#v, got %#v", p, p2) } // removed via complete dataStream := newFakeHTTPStream() dataStream.headers.Set(api.StreamType, api.StreamTypeData) complete, err := p.add(dataStream) if err != nil { t.Fatalf("unexpected error adding data stream to pair: %v", err) } if complete { t.Fatalf("unexpected complete") } errorStream := newFakeHTTPStream() errorStream.headers.Set(api.StreamType, api.StreamTypeError) complete, err = p.add(errorStream) if err != nil { t.Fatalf("unexpected error adding error stream to pair: %v", err) } if !complete { t.Fatal("unexpected incomplete") } // make sure monitorStreamPair completed <-monitorDone if !conn.removeStreamsCalled { t.Fatalf("connection remove stream not called") } conn.removeStreamsCalled = false // make sure the pair was removed if h.hasStreamPair("1") { t.Fatal("expected removal of pair after both data and error streams received") } // removed via timeout p, created = h.getStreamPair("2") if !created { t.Fatal("expected created=true") } if p == nil { t.Fatal("expected p not to be nil") } monitorDone = make(chan struct{}) go func() { h.monitorStreamPair(p, timeout) close(monitorDone) }() // cause the timeout close(timeout) // make sure monitorStreamPair completed <-monitorDone if h.hasStreamPair("2") { t.Fatal("expected stream pair to be removed") } if !conn.removeStreamsCalled { t.Fatalf("connection remove stream not called") } } func TestRequestID(t *testing.T) { h := &httpStreamHandler{} s := newFakeHTTPStream() s.headers.Set(api.StreamType, api.StreamTypeError) s.id = 1 if e, a := "1", h.requestID(s); e != a { t.Errorf("expected %q, got %q", e, a) } s.headers.Set(api.StreamType, api.StreamTypeData) s.id = 3 if e, a := "1", h.requestID(s); e != a { t.Errorf("expected %q, got %q", e, a) } s.id = 7 s.headers.Set(api.PortForwardRequestIDHeader, "2") if e, a := "2", h.requestID(s); e != a { t.Errorf("expected %q, got %q", e, a) } } type fakeHTTPStream struct { headers http.Header id uint32 } func newFakeHTTPStream() *fakeHTTPStream { return &fakeHTTPStream{ headers: make(http.Header), } } var _ httpstream.Stream = &fakeHTTPStream{} func (s *fakeHTTPStream) Read(data []byte) (int, error) { return 0, nil } func (s *fakeHTTPStream) Write(data []byte) (int, error) { return 0, nil } func (s *fakeHTTPStream) Close() error { return nil } func (s *fakeHTTPStream) Reset() error { return nil } func (s *fakeHTTPStream) Headers() http.Header { return s.headers } func (s *fakeHTTPStream) Identifier() uint32 { return s.id } kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/portforward.go000066400000000000000000000040341503561374700262200ustar00rootroot00000000000000/* Copyright 2016 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 portforward import ( "context" "io" "net/http" "time" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/runtime" ) // PortForwarder knows how to forward content from a data stream to/from a port // in a pod. type PortForwarder interface { // PortForwarder copies data between a data stream and a port in a pod. PortForward(ctx context.Context, name string, uid types.UID, port int32, stream io.ReadWriteCloser) error } // ServePortForward handles a port forwarding request. A single request is // kept alive as long as the client is still alive and the connection has not // been timed out due to idleness. This function handles multiple forwarded // connections; i.e., multiple `curl http://localhost:8888/` requests will be // handled by a single invocation of ServePortForward. func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, uid types.UID, portForwardOptions *V4Options, idleTimeout time.Duration, streamCreationTimeout time.Duration, supportedProtocols []string) { var err error if wsstream.IsWebSocketRequest(req) { err = handleWebSocketStreams(req, w, portForwarder, podName, uid, portForwardOptions, supportedProtocols, idleTimeout, streamCreationTimeout) } else { err = handleHTTPStreams(req, w, portForwarder, podName, uid, supportedProtocols, idleTimeout, streamCreationTimeout) } if err != nil { runtime.HandleError(err) return } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/websocket.go000066400000000000000000000133231503561374700256360ustar00rootroot00000000000000/* Copyright 2016 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 portforward import ( "context" "encoding/binary" "fmt" "io" "net/http" "strconv" "strings" "sync" "time" "k8s.io/klog/v2" api "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apiserver/pkg/endpoints/responsewriter" ) const ( dataChannel = iota errorChannel v4BinaryWebsocketProtocol = "v4." + wsstream.ChannelWebSocketProtocol v4Base64WebsocketProtocol = "v4." + wsstream.Base64ChannelWebSocketProtocol ) // V4Options contains details about which streams are required for port // forwarding. // All fields included in V4Options need to be expressed explicitly in the // CRI (k8s.io/cri-api/pkg/apis/{version}/api.proto) PortForwardRequest. type V4Options struct { Ports []int32 } // NewV4Options creates a new options from the Request. func NewV4Options(req *http.Request) (*V4Options, error) { if !wsstream.IsWebSocketRequest(req) { return &V4Options{}, nil } portStrings := req.URL.Query()[api.PortHeader] if len(portStrings) == 0 { return nil, fmt.Errorf("query parameter %q is required", api.PortHeader) } ports := make([]int32, 0, len(portStrings)) for _, portString := range portStrings { if len(portString) == 0 { return nil, fmt.Errorf("query parameter %q cannot be empty", api.PortHeader) } for _, p := range strings.Split(portString, ",") { port, err := strconv.ParseUint(p, 10, 16) if err != nil { return nil, fmt.Errorf("unable to parse %q as a port: %v", portString, err) } if port < 1 { return nil, fmt.Errorf("port %q must be > 0", portString) } ports = append(ports, int32(port)) } } return &V4Options{ Ports: ports, }, nil } // BuildV4Options returns a V4Options based on the given information. func BuildV4Options(ports []int32) (*V4Options, error) { return &V4Options{Ports: ports}, nil } // handleWebSocketStreams handles requests to forward ports to a pod via // a PortForwarder. A pair of streams are created per port (DATA n, // ERROR n+1). The associated port is written to each stream as a unsigned 16 // bit integer in little endian format. func handleWebSocketStreams(req *http.Request, w http.ResponseWriter, portForwarder PortForwarder, podName string, uid types.UID, opts *V4Options, supportedPortForwardProtocols []string, idleTimeout, streamCreationTimeout time.Duration) error { channels := make([]wsstream.ChannelType, 0, len(opts.Ports)*2) for i := 0; i < len(opts.Ports); i++ { channels = append(channels, wsstream.ReadWriteChannel, wsstream.WriteChannel) } conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ "": { Binary: true, Channels: channels, }, v4BinaryWebsocketProtocol: { Binary: true, Channels: channels, }, v4Base64WebsocketProtocol: { Binary: false, Channels: channels, }, }) conn.SetIdleTimeout(idleTimeout) _, streams, err := conn.Open(responsewriter.GetOriginal(w), req) if err != nil { err = fmt.Errorf("unable to upgrade websocket connection: %v", err) return err } defer conn.Close() streamPairs := make([]*websocketStreamPair, len(opts.Ports)) for i := range streamPairs { streamPair := websocketStreamPair{ port: opts.Ports[i], dataStream: streams[i*2+dataChannel], errorStream: streams[i*2+errorChannel], } streamPairs[i] = &streamPair portBytes := make([]byte, 2) // port is always positive so conversion is allowable binary.LittleEndian.PutUint16(portBytes, uint16(streamPair.port)) streamPair.dataStream.Write(portBytes) streamPair.errorStream.Write(portBytes) } h := &websocketStreamHandler{ conn: conn, streamPairs: streamPairs, pod: podName, uid: uid, forwarder: portForwarder, } h.run() return nil } // websocketStreamPair represents the error and data streams for a port // forwarding request. type websocketStreamPair struct { port int32 dataStream io.ReadWriteCloser errorStream io.WriteCloser } // websocketStreamHandler is capable of processing a single port forward // request over a websocket connection type websocketStreamHandler struct { conn *wsstream.Conn streamPairs []*websocketStreamPair pod string uid types.UID forwarder PortForwarder } // run invokes the websocketStreamHandler's forwarder.PortForward // function for the given stream pair. func (h *websocketStreamHandler) run() { wg := sync.WaitGroup{} wg.Add(len(h.streamPairs)) for _, pair := range h.streamPairs { p := pair go func() { defer wg.Done() h.portForward(p) }() } wg.Wait() } func (h *websocketStreamHandler) portForward(p *websocketStreamPair) { ctx := context.Background() defer p.dataStream.Close() defer p.errorStream.Close() klog.V(5).InfoS("Connection invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) err := h.forwarder.PortForward(ctx, h.pod, h.uid, p.port, p.dataStream) klog.V(5).InfoS("Connection done invoking forwarder.PortForward for port", "connection", h.conn, "port", p.port) if err != nil { msg := fmt.Errorf("error forwarding port %d to pod %s, uid %v: %v", p.port, h.pod, h.uid, err) runtime.HandleError(msg) fmt.Fprint(p.errorStream, msg.Error()) } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/portforward/websocket_test.go000066400000000000000000000053001503561374700266710ustar00rootroot00000000000000/* Copyright 2016 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 portforward import ( "net/http" "reflect" "testing" ) func TestV4Options(t *testing.T) { tests := map[string]struct { url string websocket bool expectedOpts *V4Options expectedError string }{ "non-ws request": { url: "http://example.com", expectedOpts: &V4Options{}, }, "missing port": { url: "http://example.com", websocket: true, expectedError: `query parameter "port" is required`, }, "unable to parse port": { url: "http://example.com?port=abc", websocket: true, expectedError: `unable to parse "abc" as a port: strconv.ParseUint: parsing "abc": invalid syntax`, }, "negative port": { url: "http://example.com?port=-1", websocket: true, expectedError: `unable to parse "-1" as a port: strconv.ParseUint: parsing "-1": invalid syntax`, }, "one port": { url: "http://example.com?port=80", websocket: true, expectedOpts: &V4Options{ Ports: []int32{80}, }, }, "multiple ports": { url: "http://example.com?port=80,90,100", websocket: true, expectedOpts: &V4Options{ Ports: []int32{80, 90, 100}, }, }, "multiple port": { url: "http://example.com?port=80&port=90", websocket: true, expectedOpts: &V4Options{ Ports: []int32{80, 90}, }, }, } for name, test := range tests { req, err := http.NewRequest(http.MethodGet, test.url, nil) if err != nil { t.Errorf("%s: invalid url %q err=%q", name, test.url, err) continue } if test.websocket { req.Header.Set("Connection", "Upgrade") req.Header.Set("Upgrade", "websocket") } opts, err := NewV4Options(req) if len(test.expectedError) > 0 { if err == nil { t.Errorf("%s: expected err=%q, but it was nil", name, test.expectedError) } if e, a := test.expectedError, err.Error(); e != a { t.Errorf("%s: expected err=%q, got %q", name, e, a) } continue } if err != nil { t.Errorf("%s: unexpected error %v", name, err) continue } if !reflect.DeepEqual(test.expectedOpts, opts) { t.Errorf("%s: expected options %#v, got %#v", name, test.expectedOpts, err) } } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/000077500000000000000000000000001503561374700236005ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/attach.go000066400000000000000000000043441503561374700254000ustar00rootroot00000000000000/* Copyright 2016 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 remotecommand import ( "context" "fmt" "io" "net/http" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/remotecommand" ) // Attacher knows how to attach to a running container in a pod. type Attacher interface { // AttachContainer attaches to the running container in the pod, copying data between in/out/err // and the container's stdin/stdout/stderr. AttachContainer(ctx context.Context, name string, uid types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error } // ServeAttach handles requests to attach to a container. After creating/receiving the required // streams, it delegates the actual attaching to attacher. func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string) { ctx, ok := createStreams(req, w, streamOpts, supportedProtocols, idleTimeout, streamCreationTimeout) if !ok { // error is handled by createStreams return } defer ctx.conn.Close() err := attacher.AttachContainer(req.Context(), podName, uid, container, ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, ctx.tty, ctx.resizeChan) if err != nil { err = fmt.Errorf("error attaching to container: %v", err) runtime.HandleError(err) ctx.writeStatus(apierrors.NewInternalError(err)) } else { ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusSuccess, }}) } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/doc.go000066400000000000000000000013601503561374700246740ustar00rootroot00000000000000/* Copyright 2016 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 remotecommand contains functions related to executing commands in and attaching to pods. package remotecommand // import "k8s.io/kubelet/pkg/cri/streaming/remotecommand" kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/exec.go000066400000000000000000000057151503561374700250630ustar00rootroot00000000000000/* Copyright 2016 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 remotecommand import ( "context" "fmt" "io" "net/http" "time" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/remotecommand" utilexec "k8s.io/utils/exec" ) // Executor knows how to execute a command in a container in a pod. type Executor interface { // ExecInContainer executes a command in a container in the pod, copying data // between in/out/err and the container's stdin/stdout/stderr. ExecInContainer(ctx context.Context, name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error } // ServeExec handles requests to execute a command in a container. After // creating/receiving the required streams, it delegates the actual execution // to the executor. func ServeExec(w http.ResponseWriter, req *http.Request, executor Executor, podName string, uid types.UID, container string, cmd []string, streamOpts *Options, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string) { ctx, ok := createStreams(req, w, streamOpts, supportedProtocols, idleTimeout, streamCreationTimeout) if !ok { // error is handled by createStreams return } defer ctx.conn.Close() err := executor.ExecInContainer(req.Context(), podName, uid, container, cmd, ctx.stdinStream, ctx.stdoutStream, ctx.stderrStream, ctx.tty, ctx.resizeChan, 0) if err != nil { if exitErr, ok := err.(utilexec.ExitError); ok && exitErr.Exited() { rc := exitErr.ExitStatus() ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusFailure, Reason: remotecommandconsts.NonZeroExitCodeReason, Details: &metav1.StatusDetails{ Causes: []metav1.StatusCause{ { Type: remotecommandconsts.ExitCodeCauseType, Message: fmt.Sprintf("%d", rc), }, }, }, Message: fmt.Sprintf("command terminated with non-zero exit code: %v", exitErr), }}) } else { err = fmt.Errorf("error executing command in container: %v", err) runtime.HandleError(err) ctx.writeStatus(apierrors.NewInternalError(err)) } } else { ctx.writeStatus(&apierrors.StatusError{ErrStatus: metav1.Status{ Status: metav1.StatusSuccess, }}) } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/httpstream.go000066400000000000000000000342401503561374700263250ustar00rootroot00000000000000/* Copyright 2016 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 remotecommand import ( "encoding/json" "errors" "fmt" "io" "net/http" "time" api "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/httpstream/spdy" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/tools/remotecommand" "k8s.io/klog/v2" ) // Options contains details about which streams are required for // remote command execution. type Options struct { Stdin bool Stdout bool Stderr bool TTY bool } // NewOptions creates a new Options from the Request. func NewOptions(req *http.Request) (*Options, error) { tty := req.FormValue(api.ExecTTYParam) == "1" stdin := req.FormValue(api.ExecStdinParam) == "1" stdout := req.FormValue(api.ExecStdoutParam) == "1" stderr := req.FormValue(api.ExecStderrParam) == "1" if tty && stderr { // TODO: make this an error before we reach this method klog.V(4).InfoS("Access to exec with tty and stderr is not supported, bypassing stderr") stderr = false } if !stdin && !stdout && !stderr { return nil, fmt.Errorf("you must specify at least 1 of stdin, stdout, stderr") } return &Options{ Stdin: stdin, Stdout: stdout, Stderr: stderr, TTY: tty, }, nil } // connectionContext contains the connection and streams used when // forwarding an attach or execute session into a container. type connectionContext struct { conn io.Closer stdinStream io.ReadCloser stdoutStream io.WriteCloser stderrStream io.WriteCloser writeStatus func(status *apierrors.StatusError) error resizeStream io.ReadCloser resizeChan chan remotecommand.TerminalSize tty bool } // streamAndReply holds both a Stream and a channel that is closed when the stream's reply frame is // enqueued. Consumers can wait for replySent to be closed prior to proceeding, to ensure that the // replyFrame is enqueued before the connection's goaway frame is sent (e.g. if a stream was // received and right after, the connection gets closed). type streamAndReply struct { httpstream.Stream replySent <-chan struct{} } // waitStreamReply waits until either replySent or stop is closed. If replySent is closed, it sends // an empty struct to the notify channel. func waitStreamReply(replySent <-chan struct{}, notify chan<- struct{}, stop <-chan struct{}) { select { case <-replySent: notify <- struct{}{} case <-stop: } } func createStreams(req *http.Request, w http.ResponseWriter, opts *Options, supportedStreamProtocols []string, idleTimeout, streamCreationTimeout time.Duration) (*connectionContext, bool) { var ctx *connectionContext var ok bool if wsstream.IsWebSocketRequest(req) { ctx, ok = createWebSocketStreams(req, w, opts, idleTimeout) } else { ctx, ok = createHTTPStreamStreams(req, w, opts, supportedStreamProtocols, idleTimeout, streamCreationTimeout) } if !ok { return nil, false } if ctx.resizeStream != nil { ctx.resizeChan = make(chan remotecommand.TerminalSize) go handleResizeEvents(ctx.resizeStream, ctx.resizeChan) } return ctx, true } func createHTTPStreamStreams(req *http.Request, w http.ResponseWriter, opts *Options, supportedStreamProtocols []string, idleTimeout, streamCreationTimeout time.Duration) (*connectionContext, bool) { protocol, err := httpstream.Handshake(req, w, supportedStreamProtocols) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest) return nil, false } streamCh := make(chan streamAndReply) upgrader := spdy.NewResponseUpgrader() conn := upgrader.UpgradeResponse(w, req, func(stream httpstream.Stream, replySent <-chan struct{}) error { streamCh <- streamAndReply{Stream: stream, replySent: replySent} return nil }) // from this point on, we can no longer call methods on response if conn == nil { // The upgrader is responsible for notifying the client of any errors that // occurred during upgrading. All we can do is return here at this point // if we weren't successful in upgrading. return nil, false } conn.SetIdleTimeout(idleTimeout) var handler protocolHandler switch protocol { case remotecommandconsts.StreamProtocolV4Name: handler = &v4ProtocolHandler{} case remotecommandconsts.StreamProtocolV3Name: handler = &v3ProtocolHandler{} case remotecommandconsts.StreamProtocolV2Name: handler = &v2ProtocolHandler{} case "": klog.V(4).InfoS("Client did not request protocol negotiation. Falling back", "protocol", remotecommandconsts.StreamProtocolV1Name) fallthrough case remotecommandconsts.StreamProtocolV1Name: handler = &v1ProtocolHandler{} } // count the streams client asked for, starting with 1 expectedStreams := 1 if opts.Stdin { expectedStreams++ } if opts.Stdout { expectedStreams++ } if opts.Stderr { expectedStreams++ } if opts.TTY && handler.supportsTerminalResizing() { expectedStreams++ } expired := time.NewTimer(streamCreationTimeout) defer expired.Stop() ctx, err := handler.waitForStreams(streamCh, expectedStreams, expired.C) if err != nil { runtime.HandleError(err) return nil, false } ctx.conn = conn ctx.tty = opts.TTY return ctx, true } type protocolHandler interface { // waitForStreams waits for the expected streams or a timeout, returning a // remoteCommandContext if all the streams were received, or an error if not. waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) // supportsTerminalResizing returns true if the protocol handler supports terminal resizing supportsTerminalResizing() bool } // v4ProtocolHandler implements the V4 protocol version for streaming command execution. It only differs // in from v3 in the error stream format using an json-marshaled metav1.Status which carries // the process' exit code. type v4ProtocolHandler struct{} func (*v4ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { ctx := &connectionContext{} receivedStreams := 0 replyChan := make(chan struct{}) stop := make(chan struct{}) defer close(stop) WaitForStreams: for { select { case stream := <-streams: streamType := stream.Headers().Get(api.StreamType) switch streamType { case api.StreamTypeError: ctx.writeStatus = v4WriteStatusFunc(stream) // write json errors go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: ctx.stdinStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: ctx.stdoutStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: ctx.stderrStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeResize: ctx.resizeStream = stream go waitStreamReply(stream.replySent, replyChan, stop) default: runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) } case <-replyChan: receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } case <-expired: // TODO find a way to return the error to the user. Maybe use a separate // stream to report errors? return nil, errors.New("timed out waiting for client to create streams") } } return ctx, nil } // supportsTerminalResizing returns true because v4ProtocolHandler supports it func (*v4ProtocolHandler) supportsTerminalResizing() bool { return true } // v3ProtocolHandler implements the V3 protocol version for streaming command execution. type v3ProtocolHandler struct{} func (*v3ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { ctx := &connectionContext{} receivedStreams := 0 replyChan := make(chan struct{}) stop := make(chan struct{}) defer close(stop) WaitForStreams: for { select { case stream := <-streams: streamType := stream.Headers().Get(api.StreamType) switch streamType { case api.StreamTypeError: ctx.writeStatus = v1WriteStatusFunc(stream) go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: ctx.stdinStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: ctx.stdoutStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: ctx.stderrStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeResize: ctx.resizeStream = stream go waitStreamReply(stream.replySent, replyChan, stop) default: runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) } case <-replyChan: receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } case <-expired: // TODO find a way to return the error to the user. Maybe use a separate // stream to report errors? return nil, errors.New("timed out waiting for client to create streams") } } return ctx, nil } // supportsTerminalResizing returns true because v3ProtocolHandler supports it func (*v3ProtocolHandler) supportsTerminalResizing() bool { return true } // v2ProtocolHandler implements the V2 protocol version for streaming command execution. type v2ProtocolHandler struct{} func (*v2ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { ctx := &connectionContext{} receivedStreams := 0 replyChan := make(chan struct{}) stop := make(chan struct{}) defer close(stop) WaitForStreams: for { select { case stream := <-streams: streamType := stream.Headers().Get(api.StreamType) switch streamType { case api.StreamTypeError: ctx.writeStatus = v1WriteStatusFunc(stream) go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: ctx.stdinStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: ctx.stdoutStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: ctx.stderrStream = stream go waitStreamReply(stream.replySent, replyChan, stop) default: runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) } case <-replyChan: receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } case <-expired: // TODO find a way to return the error to the user. Maybe use a separate // stream to report errors? return nil, errors.New("timed out waiting for client to create streams") } } return ctx, nil } // supportsTerminalResizing returns false because v2ProtocolHandler doesn't support it. func (*v2ProtocolHandler) supportsTerminalResizing() bool { return false } // v1ProtocolHandler implements the V1 protocol version for streaming command execution. type v1ProtocolHandler struct{} func (*v1ProtocolHandler) waitForStreams(streams <-chan streamAndReply, expectedStreams int, expired <-chan time.Time) (*connectionContext, error) { ctx := &connectionContext{} receivedStreams := 0 replyChan := make(chan struct{}) stop := make(chan struct{}) defer close(stop) WaitForStreams: for { select { case stream := <-streams: streamType := stream.Headers().Get(api.StreamType) switch streamType { case api.StreamTypeError: ctx.writeStatus = v1WriteStatusFunc(stream) // This defer statement shouldn't be here, but due to previous refactoring, it ended up in // here. This is what 1.0.x kubelets do, so we're retaining that behavior. This is fixed in // the v2ProtocolHandler. defer stream.Reset() go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdin: ctx.stdinStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStdout: ctx.stdoutStream = stream go waitStreamReply(stream.replySent, replyChan, stop) case api.StreamTypeStderr: ctx.stderrStream = stream go waitStreamReply(stream.replySent, replyChan, stop) default: runtime.HandleError(fmt.Errorf("unexpected stream type: %q", streamType)) } case <-replyChan: receivedStreams++ if receivedStreams == expectedStreams { break WaitForStreams } case <-expired: // TODO find a way to return the error to the user. Maybe use a separate // stream to report errors? return nil, errors.New("timed out waiting for client to create streams") } } if ctx.stdinStream != nil { ctx.stdinStream.Close() } return ctx, nil } // supportsTerminalResizing returns false because v1ProtocolHandler doesn't support it. func (*v1ProtocolHandler) supportsTerminalResizing() bool { return false } func handleResizeEvents(stream io.Reader, channel chan<- remotecommand.TerminalSize) { defer runtime.HandleCrash() defer close(channel) decoder := json.NewDecoder(stream) for { size := remotecommand.TerminalSize{} if err := decoder.Decode(&size); err != nil { break } channel <- size } } func v1WriteStatusFunc(stream io.Writer) func(status *apierrors.StatusError) error { return func(status *apierrors.StatusError) error { if status.Status().Status == metav1.StatusSuccess { return nil // send error messages } _, err := stream.Write([]byte(status.Error())) return err } } // v4WriteStatusFunc returns a WriteStatusFunc that marshals a given api Status // as json in the error channel. func v4WriteStatusFunc(stream io.Writer) func(status *apierrors.StatusError) error { return func(status *apierrors.StatusError) error { bs, err := json.Marshal(status.Status()) if err != nil { return err } _, err = stream.Write(bs) return err } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/remotecommand/websocket.go000066400000000000000000000100211503561374700261070ustar00rootroot00000000000000/* Copyright 2016 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 remotecommand import ( "fmt" "net/http" "time" "k8s.io/apimachinery/pkg/util/httpstream/wsstream" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apiserver/pkg/endpoints/responsewriter" ) const ( stdinChannel = iota stdoutChannel stderrChannel errorChannel resizeChannel preV4BinaryWebsocketProtocol = wsstream.ChannelWebSocketProtocol preV4Base64WebsocketProtocol = wsstream.Base64ChannelWebSocketProtocol v4BinaryWebsocketProtocol = "v4." + wsstream.ChannelWebSocketProtocol v4Base64WebsocketProtocol = "v4." + wsstream.Base64ChannelWebSocketProtocol ) // createChannels returns the standard channel types for a shell connection (STDIN 0, STDOUT 1, STDERR 2) // along with the approximate duplex value. It also creates the error (3) and resize (4) channels. func createChannels(opts *Options) []wsstream.ChannelType { // open the requested channels, and always open the error channel channels := make([]wsstream.ChannelType, 5) channels[stdinChannel] = readChannel(opts.Stdin) channels[stdoutChannel] = writeChannel(opts.Stdout) channels[stderrChannel] = writeChannel(opts.Stderr) channels[errorChannel] = wsstream.WriteChannel channels[resizeChannel] = wsstream.ReadChannel return channels } // readChannel returns wsstream.ReadChannel if real is true, or wsstream.IgnoreChannel. func readChannel(real bool) wsstream.ChannelType { if real { return wsstream.ReadChannel } return wsstream.IgnoreChannel } // writeChannel returns wsstream.WriteChannel if real is true, or wsstream.IgnoreChannel. func writeChannel(real bool) wsstream.ChannelType { if real { return wsstream.WriteChannel } return wsstream.IgnoreChannel } // createWebSocketStreams returns a connectionContext containing the websocket connection and // streams needed to perform an exec or an attach. func createWebSocketStreams(req *http.Request, w http.ResponseWriter, opts *Options, idleTimeout time.Duration) (*connectionContext, bool) { channels := createChannels(opts) conn := wsstream.NewConn(map[string]wsstream.ChannelProtocolConfig{ "": { Binary: true, Channels: channels, }, preV4BinaryWebsocketProtocol: { Binary: true, Channels: channels, }, preV4Base64WebsocketProtocol: { Binary: false, Channels: channels, }, v4BinaryWebsocketProtocol: { Binary: true, Channels: channels, }, v4Base64WebsocketProtocol: { Binary: false, Channels: channels, }, }) conn.SetIdleTimeout(idleTimeout) negotiatedProtocol, streams, err := conn.Open(responsewriter.GetOriginal(w), req) if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade websocket connection: %v", err)) return nil, false } // Send an empty message to the lowest writable channel to notify the client the connection is established // TODO: make generic to SPDY and WebSockets and do it outside of this method? switch { case opts.Stdout: streams[stdoutChannel].Write([]byte{}) case opts.Stderr: streams[stderrChannel].Write([]byte{}) default: streams[errorChannel].Write([]byte{}) } ctx := &connectionContext{ conn: conn, stdinStream: streams[stdinChannel], stdoutStream: streams[stdoutChannel], stderrStream: streams[stderrChannel], tty: opts.TTY, resizeStream: streams[resizeChannel], } switch negotiatedProtocol { case v4BinaryWebsocketProtocol, v4Base64WebsocketProtocol: ctx.writeStatus = v4WriteStatusFunc(streams[errorChannel]) default: ctx.writeStatus = v1WriteStatusFunc(streams[errorChannel]) } return ctx, true } kubelet-kubernetes-1.32.7/pkg/cri/streaming/request_cache.go000066400000000000000000000075771503561374700241300ustar00rootroot00000000000000/* Copyright 2016 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 streaming import ( "container/list" "crypto/rand" "encoding/base64" "fmt" "math" "sync" "time" "k8s.io/utils/clock" ) var ( // cacheTTL is the timeout after which tokens become invalid. cacheTTL = 1 * time.Minute // maxInFlight is the maximum number of in-flight requests to allow. maxInFlight = 1000 // tokenLen is the length of the random base64 encoded token identifying the request. tokenLen = 8 ) // requestCache caches streaming (exec/attach/port-forward) requests and generates a single-use // random token for their retrieval. The requestCache is used for building streaming URLs without // the need to encode every request parameter in the URL. type requestCache struct { // clock is used to obtain the current time clock clock.Clock // tokens maps the generate token to the request for fast retrieval. tokens map[string]*list.Element // ll maintains an age-ordered request list for faster garbage collection of expired requests. ll *list.List lock sync.Mutex } // Type representing an *ExecRequest, *AttachRequest, or *PortForwardRequest. type request interface{} type cacheEntry struct { token string `datapolicy:"token"` req request expireTime time.Time } func newRequestCache() *requestCache { return &requestCache{ clock: clock.RealClock{}, ll: list.New(), tokens: make(map[string]*list.Element), } } // Insert the given request into the cache and returns the token used for fetching it out. func (c *requestCache) Insert(req request) (token string, err error) { c.lock.Lock() defer c.lock.Unlock() // Remove expired entries. c.gc() // If the cache is full, reject the request. if c.ll.Len() == maxInFlight { return "", NewErrorTooManyInFlight() } token, err = c.uniqueToken() if err != nil { return "", err } ele := c.ll.PushFront(&cacheEntry{token, req, c.clock.Now().Add(cacheTTL)}) c.tokens[token] = ele return token, nil } // Consume the token (remove it from the cache) and return the cached request, if found. func (c *requestCache) Consume(token string) (req request, found bool) { c.lock.Lock() defer c.lock.Unlock() ele, ok := c.tokens[token] if !ok { return nil, false } c.ll.Remove(ele) delete(c.tokens, token) entry := ele.Value.(*cacheEntry) if c.clock.Now().After(entry.expireTime) { // Entry already expired. return nil, false } return entry.req, true } // uniqueToken generates a random URL-safe token and ensures uniqueness. func (c *requestCache) uniqueToken() (string, error) { const maxTries = 10 // Number of bytes to be tokenLen when base64 encoded. tokenSize := math.Ceil(float64(tokenLen) * 6 / 8) rawToken := make([]byte, int(tokenSize)) for i := 0; i < maxTries; i++ { if _, err := rand.Read(rawToken); err != nil { return "", err } encoded := base64.RawURLEncoding.EncodeToString(rawToken) token := encoded[:tokenLen] // If it's unique, return it. Otherwise retry. if _, exists := c.tokens[encoded]; !exists { return token, nil } } return "", fmt.Errorf("failed to generate unique token") } // Must be write-locked prior to calling. func (c *requestCache) gc() { now := c.clock.Now() for c.ll.Len() > 0 { oldest := c.ll.Back() entry := oldest.Value.(*cacheEntry) if !now.After(entry.expireTime) { return } // Oldest value is expired; remove it. c.ll.Remove(oldest) delete(c.tokens, entry.token) } } kubelet-kubernetes-1.32.7/pkg/cri/streaming/request_cache_test.go000066400000000000000000000126161503561374700251550ustar00rootroot00000000000000/* Copyright 2016 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 streaming import ( "net/http" "net/http/httptest" "strconv" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" testingclock "k8s.io/utils/clock/testing" ) func TestInsert(t *testing.T) { c, _ := newTestCache() // Insert normal oldestTok, err := c.Insert(nextRequest()) require.NoError(t, err) assert.Len(t, oldestTok, tokenLen) assertCacheSize(t, c, 1) // Insert until full for i := 0; i < maxInFlight-2; i++ { tok, err := c.Insert(nextRequest()) require.NoError(t, err) assert.Len(t, tok, tokenLen) } assertCacheSize(t, c, maxInFlight-1) newestReq := nextRequest() newestTok, err := c.Insert(newestReq) require.NoError(t, err) assert.Len(t, newestTok, tokenLen) assertCacheSize(t, c, maxInFlight) require.Contains(t, c.tokens, oldestTok, "oldest request should still be cached") // Consume newest token. req, ok := c.Consume(newestTok) assert.True(t, ok, "newest request should still be cached") assert.Equal(t, newestReq, req) require.Contains(t, c.tokens, oldestTok, "oldest request should still be cached") // Insert again (still full) tok, err := c.Insert(nextRequest()) require.NoError(t, err) assert.Len(t, tok, tokenLen) assertCacheSize(t, c, maxInFlight) // Insert again (should evict) _, err = c.Insert(nextRequest()) assert.Error(t, err, "should reject further requests") recorder := httptest.NewRecorder() require.NoError(t, WriteError(err, recorder)) errResponse := recorder.Result() assert.Equal(t, http.StatusTooManyRequests, errResponse.StatusCode) assert.Equal(t, strconv.Itoa(int(cacheTTL.Seconds())), errResponse.Header.Get("Retry-After")) assertCacheSize(t, c, maxInFlight) _, ok = c.Consume(oldestTok) assert.True(t, ok, "oldest request should be valid") } func TestConsume(t *testing.T) { c, clock := newTestCache() { // Insert & consume. req := nextRequest() tok, err := c.Insert(req) require.NoError(t, err) assertCacheSize(t, c, 1) cachedReq, ok := c.Consume(tok) assert.True(t, ok) assert.Equal(t, req, cachedReq) assertCacheSize(t, c, 0) } { // Insert & consume out of order req1 := nextRequest() tok1, err := c.Insert(req1) require.NoError(t, err) assertCacheSize(t, c, 1) req2 := nextRequest() tok2, err := c.Insert(req2) require.NoError(t, err) assertCacheSize(t, c, 2) cachedReq2, ok := c.Consume(tok2) assert.True(t, ok) assert.Equal(t, req2, cachedReq2) assertCacheSize(t, c, 1) cachedReq1, ok := c.Consume(tok1) assert.True(t, ok) assert.Equal(t, req1, cachedReq1) assertCacheSize(t, c, 0) } { // Consume a second time req := nextRequest() tok, err := c.Insert(req) require.NoError(t, err) assertCacheSize(t, c, 1) cachedReq, ok := c.Consume(tok) assert.True(t, ok) assert.Equal(t, req, cachedReq) assertCacheSize(t, c, 0) _, ok = c.Consume(tok) assert.False(t, ok) assertCacheSize(t, c, 0) } { // Consume without insert _, ok := c.Consume("fooBAR") assert.False(t, ok) assertCacheSize(t, c, 0) } { // Consume expired tok, err := c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 1) clock.Step(2 * cacheTTL) _, ok := c.Consume(tok) assert.False(t, ok) assertCacheSize(t, c, 0) } } func TestGC(t *testing.T) { c, clock := newTestCache() // When empty c.gc() assertCacheSize(t, c, 0) tok1, err := c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 1) clock.Step(10 * time.Second) tok2, err := c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 2) // expired: tok1, tok2 // non-expired: tok3, tok4 clock.Step(2 * cacheTTL) tok3, err := c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 1) clock.Step(10 * time.Second) tok4, err := c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 2) _, ok := c.Consume(tok1) assert.False(t, ok) _, ok = c.Consume(tok2) assert.False(t, ok) _, ok = c.Consume(tok3) assert.True(t, ok) _, ok = c.Consume(tok4) assert.True(t, ok) // When full, nothing is expired. for i := 0; i < maxInFlight; i++ { _, err := c.Insert(nextRequest()) require.NoError(t, err) } assertCacheSize(t, c, maxInFlight) // When everything is expired clock.Step(2 * cacheTTL) _, err = c.Insert(nextRequest()) require.NoError(t, err) assertCacheSize(t, c, 1) } func newTestCache() (*requestCache, *testingclock.FakeClock) { c := newRequestCache() fakeClock := testingclock.NewFakeClock(time.Now()) c.clock = fakeClock return c, fakeClock } func assertCacheSize(t *testing.T, cache *requestCache, expectedSize int) { tokenLen := len(cache.tokens) llLen := cache.ll.Len() assert.Equal(t, tokenLen, llLen, "inconsistent cache size! len(tokens)=%d; len(ll)=%d", tokenLen, llLen) assert.Equal(t, expectedSize, tokenLen, "unexpected cache size!") } var requestUID = 0 func nextRequest() interface{} { requestUID++ return requestUID } kubelet-kubernetes-1.32.7/pkg/cri/streaming/server.go000066400000000000000000000272131503561374700226100ustar00rootroot00000000000000/* Copyright 2016 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 streaming import ( "context" "crypto/tls" "errors" "io" "net" "net/http" "net/url" "path" "time" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" restful "github.com/emicklei/go-restful/v3" "k8s.io/apimachinery/pkg/types" remotecommandconsts "k8s.io/apimachinery/pkg/util/remotecommand" "k8s.io/client-go/tools/remotecommand" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" "k8s.io/kubelet/pkg/cri/streaming/portforward" remotecommandserver "k8s.io/kubelet/pkg/cri/streaming/remotecommand" ) // Server is the library interface to serve the stream requests. type Server interface { http.Handler // Get the serving URL for the requests. // Requests must not be nil. Responses may be nil iff an error is returned. GetExec(*runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) GetAttach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) GetPortForward(*runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) // Start the server. // addr is the address to serve on (address:port) stayUp indicates whether the server should // listen until Stop() is called, or automatically stop after all expected connections are // closed. Calling Get{Exec,Attach,PortForward} increments the expected connection count. // Function does not return until the server is stopped. Start(stayUp bool) error // Stop the server, and terminate any open connections. Stop() error } // Runtime is the interface to execute the commands and provide the streams. type Runtime interface { Exec(ctx context.Context, containerID string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error Attach(ctx context.Context, containerID string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error PortForward(ctx context.Context, podSandboxID string, port int32, stream io.ReadWriteCloser) error } // Config defines the options used for running the stream server. type Config struct { // The host:port address the server will listen on. Addr string // The optional base URL for constructing streaming URLs. If empty, the baseURL will be // constructed from the serve address. // Note that for port "0", the URL port will be set to actual port in use. BaseURL *url.URL // How long to leave idle connections open for. StreamIdleTimeout time.Duration // How long to wait for clients to create streams. Only used for SPDY streaming. StreamCreationTimeout time.Duration // The streaming protocols the server supports (understands and permits). See // k8s.io/kubernetes/pkg/kubelet/server/remotecommand/constants.go for available protocols. // Only used for SPDY streaming. SupportedRemoteCommandProtocols []string // The streaming protocols the server supports (understands and permits). See // k8s.io/kubernetes/pkg/kubelet/server/portforward/constants.go for available protocols. // Only used for SPDY streaming. SupportedPortForwardProtocols []string // The config for serving over TLS. If nil, TLS will not be used. TLSConfig *tls.Config } // DefaultConfig provides default values for server Config. The DefaultConfig is partial, so // some fields like Addr must still be provided. var DefaultConfig = Config{ StreamIdleTimeout: 4 * time.Hour, StreamCreationTimeout: remotecommandconsts.DefaultStreamCreationTimeout, SupportedRemoteCommandProtocols: remotecommandconsts.SupportedStreamingProtocols, SupportedPortForwardProtocols: portforward.SupportedProtocols, } // NewServer creates a new Server for stream requests. // TODO(tallclair): Add auth(n/z) interface & handling. func NewServer(config Config, runtime Runtime) (Server, error) { s := &server{ config: config, runtime: &criAdapter{runtime}, cache: newRequestCache(), } if s.config.BaseURL == nil { s.config.BaseURL = &url.URL{ Scheme: "http", Host: s.config.Addr, } if s.config.TLSConfig != nil { s.config.BaseURL.Scheme = "https" } } ws := &restful.WebService{} endpoints := []struct { path string handler restful.RouteFunction }{ {"/exec/{token}", s.serveExec}, {"/attach/{token}", s.serveAttach}, {"/portforward/{token}", s.servePortForward}, } // If serving relative to a base path, set that here. pathPrefix := path.Dir(s.config.BaseURL.Path) for _, e := range endpoints { for _, method := range []string{"GET", "POST"} { ws.Route(ws. Method(method). Path(path.Join(pathPrefix, e.path)). To(e.handler)) } } handler := restful.NewContainer() handler.Add(ws) s.handler = handler s.server = &http.Server{ Addr: s.config.Addr, Handler: s.handler, TLSConfig: s.config.TLSConfig, } return s, nil } type server struct { config Config runtime *criAdapter handler http.Handler cache *requestCache server *http.Server } func validateExecRequest(req *runtimeapi.ExecRequest) error { if req.ContainerId == "" { return status.Errorf(codes.InvalidArgument, "missing required container_id") } if req.Tty && req.Stderr { // If TTY is set, stderr cannot be true because multiplexing is not // supported. return status.Errorf(codes.InvalidArgument, "tty and stderr cannot both be true") } if !req.Stdin && !req.Stdout && !req.Stderr { return status.Errorf(codes.InvalidArgument, "one of stdin, stdout, or stderr must be set") } return nil } func (s *server) GetExec(req *runtimeapi.ExecRequest) (*runtimeapi.ExecResponse, error) { if err := validateExecRequest(req); err != nil { return nil, err } token, err := s.cache.Insert(req) if err != nil { return nil, err } return &runtimeapi.ExecResponse{ Url: s.buildURL("exec", token), }, nil } func validateAttachRequest(req *runtimeapi.AttachRequest) error { if req.ContainerId == "" { return status.Errorf(codes.InvalidArgument, "missing required container_id") } if req.Tty && req.Stderr { // If TTY is set, stderr cannot be true because multiplexing is not // supported. return status.Errorf(codes.InvalidArgument, "tty and stderr cannot both be true") } if !req.Stdin && !req.Stdout && !req.Stderr { return status.Errorf(codes.InvalidArgument, "one of stdin, stdout, and stderr must be set") } return nil } func (s *server) GetAttach(req *runtimeapi.AttachRequest) (*runtimeapi.AttachResponse, error) { if err := validateAttachRequest(req); err != nil { return nil, err } token, err := s.cache.Insert(req) if err != nil { return nil, err } return &runtimeapi.AttachResponse{ Url: s.buildURL("attach", token), }, nil } func (s *server) GetPortForward(req *runtimeapi.PortForwardRequest) (*runtimeapi.PortForwardResponse, error) { if req.PodSandboxId == "" { return nil, status.Errorf(codes.InvalidArgument, "missing required pod_sandbox_id") } token, err := s.cache.Insert(req) if err != nil { return nil, err } return &runtimeapi.PortForwardResponse{ Url: s.buildURL("portforward", token), }, nil } func (s *server) Start(stayUp bool) error { if !stayUp { // TODO(tallclair): Implement this. return errors.New("stayUp=false is not yet implemented") } listener, err := net.Listen("tcp", s.config.Addr) if err != nil { return err } // Use the actual address as baseURL host. This handles the "0" port case. s.config.BaseURL.Host = listener.Addr().String() if s.config.TLSConfig != nil { return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig. } return s.server.Serve(listener) } func (s *server) Stop() error { return s.server.Close() } func (s *server) ServeHTTP(w http.ResponseWriter, r *http.Request) { s.handler.ServeHTTP(w, r) } func (s *server) buildURL(method, token string) string { return s.config.BaseURL.ResolveReference(&url.URL{ Path: path.Join(method, token), }).String() } func (s *server) serveExec(req *restful.Request, resp *restful.Response) { token := req.PathParameter("token") cachedRequest, ok := s.cache.Consume(token) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } exec, ok := cachedRequest.(*runtimeapi.ExecRequest) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } streamOpts := &remotecommandserver.Options{ Stdin: exec.Stdin, Stdout: exec.Stdout, Stderr: exec.Stderr, TTY: exec.Tty, } remotecommandserver.ServeExec( resp.ResponseWriter, req.Request, s.runtime, "", // unused: podName "", // unusued: podUID exec.ContainerId, exec.Cmd, streamOpts, s.config.StreamIdleTimeout, s.config.StreamCreationTimeout, s.config.SupportedRemoteCommandProtocols) } func (s *server) serveAttach(req *restful.Request, resp *restful.Response) { token := req.PathParameter("token") cachedRequest, ok := s.cache.Consume(token) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } attach, ok := cachedRequest.(*runtimeapi.AttachRequest) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } streamOpts := &remotecommandserver.Options{ Stdin: attach.Stdin, Stdout: attach.Stdout, Stderr: attach.Stderr, TTY: attach.Tty, } remotecommandserver.ServeAttach( resp.ResponseWriter, req.Request, s.runtime, "", // unused: podName "", // unusued: podUID attach.ContainerId, streamOpts, s.config.StreamIdleTimeout, s.config.StreamCreationTimeout, s.config.SupportedRemoteCommandProtocols) } func (s *server) servePortForward(req *restful.Request, resp *restful.Response) { token := req.PathParameter("token") cachedRequest, ok := s.cache.Consume(token) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } pf, ok := cachedRequest.(*runtimeapi.PortForwardRequest) if !ok { http.NotFound(resp.ResponseWriter, req.Request) return } portForwardOptions, err := portforward.BuildV4Options(pf.Port) if err != nil { resp.WriteError(http.StatusBadRequest, err) return } portforward.ServePortForward( resp.ResponseWriter, req.Request, s.runtime, pf.PodSandboxId, "", // unused: podUID portForwardOptions, s.config.StreamIdleTimeout, s.config.StreamCreationTimeout, s.config.SupportedPortForwardProtocols) } // criAdapter wraps the Runtime functions to conform to the remotecommand interfaces. // The adapter binds the container ID to the container name argument, and the pod sandbox ID to the pod name. type criAdapter struct { Runtime } var _ remotecommandserver.Executor = &criAdapter{} var _ remotecommandserver.Attacher = &criAdapter{} var _ portforward.PortForwarder = &criAdapter{} func (a *criAdapter) ExecInContainer(ctx context.Context, podName string, podUID types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error { return a.Runtime.Exec(ctx, container, cmd, in, out, err, tty, resize) } func (a *criAdapter) AttachContainer(ctx context.Context, podName string, podUID types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error { return a.Runtime.Attach(ctx, container, in, out, err, tty, resize) } func (a *criAdapter) PortForward(ctx context.Context, podName string, podUID types.UID, port int32, stream io.ReadWriteCloser) error { return a.Runtime.PortForward(ctx, podName, port, stream) } kubelet-kubernetes-1.32.7/pkg/cri/streaming/server_test.go000066400000000000000000000320661503561374700236510ustar00rootroot00000000000000/* Copyright 2016 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 streaming import ( "context" "crypto/tls" "io" "net/http" "net/http/httptest" "net/url" "strconv" "strings" "sync" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" api "k8s.io/api/core/v1" restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" "k8s.io/client-go/transport/spdy" runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1" kubeletportforward "k8s.io/kubelet/pkg/cri/streaming/portforward" ) const ( testAddr = "localhost:12345" testContainerID = "container789" testPodSandboxID = "pod0987" ) func TestGetExec(t *testing.T) { serv, err := NewServer(Config{ Addr: testAddr, }, nil) assert.NoError(t, err) tlsServer, err := NewServer(Config{ Addr: testAddr, TLSConfig: &tls.Config{}, }, nil) assert.NoError(t, err) const pathPrefix = "cri/shim" prefixServer, err := NewServer(Config{ Addr: testAddr, BaseURL: &url.URL{ Scheme: "http", Host: testAddr, Path: "/" + pathPrefix + "/", }, }, nil) assert.NoError(t, err) assertRequestToken := func(expectedReq *runtimeapi.ExecRequest, cache *requestCache, token string) { req, ok := cache.Consume(token) require.True(t, ok, "token %s not found!", token) assert.Equal(t, expectedReq, req) } request := &runtimeapi.ExecRequest{ ContainerId: testContainerID, Cmd: []string{"echo", "foo"}, Tty: true, Stdin: true, } { // Non-TLS resp, err := serv.GetExec(request) assert.NoError(t, err) expectedURL := "http://" + testAddr + "/exec/" assert.Contains(t, resp.Url, expectedURL) token := strings.TrimPrefix(resp.Url, expectedURL) assertRequestToken(request, serv.(*server).cache, token) } { // TLS resp, err := tlsServer.GetExec(request) assert.NoError(t, err) expectedURL := "https://" + testAddr + "/exec/" assert.Contains(t, resp.Url, expectedURL) token := strings.TrimPrefix(resp.Url, expectedURL) assertRequestToken(request, tlsServer.(*server).cache, token) } { // Path prefix resp, err := prefixServer.GetExec(request) assert.NoError(t, err) expectedURL := "http://" + testAddr + "/" + pathPrefix + "/exec/" assert.Contains(t, resp.Url, expectedURL) token := strings.TrimPrefix(resp.Url, expectedURL) assertRequestToken(request, prefixServer.(*server).cache, token) } } func TestValidateExecAttachRequest(t *testing.T) { type config struct { tty bool stdin bool stdout bool stderr bool } for _, tc := range []struct { desc string configs []config expectErr bool }{ { desc: "at least one stream must be true", expectErr: true, configs: []config{ {false, false, false, false}, {true, false, false, false}}, }, { desc: "tty and stderr cannot both be true", expectErr: true, configs: []config{ {true, false, false, true}, {true, false, true, true}, {true, true, false, true}, {true, true, true, true}, }, }, { desc: "a valid config should pass", expectErr: false, configs: []config{ {false, false, false, true}, {false, false, true, false}, {false, false, true, true}, {false, true, false, false}, {false, true, false, true}, {false, true, true, false}, {false, true, true, true}, {true, false, true, false}, {true, true, false, false}, {true, true, true, false}, }, }, } { t.Run(tc.desc, func(t *testing.T) { for _, c := range tc.configs { // validate the exec request. execReq := &runtimeapi.ExecRequest{ ContainerId: testContainerID, Cmd: []string{"date"}, Tty: c.tty, Stdin: c.stdin, Stdout: c.stdout, Stderr: c.stderr, } err := validateExecRequest(execReq) assert.Equal(t, tc.expectErr, err != nil, "config: %v, err: %v", c, err) // validate the attach request. attachReq := &runtimeapi.AttachRequest{ ContainerId: testContainerID, Tty: c.tty, Stdin: c.stdin, Stdout: c.stdout, Stderr: c.stderr, } err = validateAttachRequest(attachReq) assert.Equal(t, tc.expectErr, err != nil, "config: %v, err: %v", c, err) } }) } } func TestGetAttach(t *testing.T) { serv, err := NewServer(Config{ Addr: testAddr, }, nil) require.NoError(t, err) tlsServer, err := NewServer(Config{ Addr: testAddr, TLSConfig: &tls.Config{}, }, nil) require.NoError(t, err) assertRequestToken := func(expectedReq *runtimeapi.AttachRequest, cache *requestCache, token string) { req, ok := cache.Consume(token) require.True(t, ok, "token %s not found!", token) assert.Equal(t, expectedReq, req) } request := &runtimeapi.AttachRequest{ ContainerId: testContainerID, Stdin: true, Tty: true, } { // Non-TLS resp, err := serv.GetAttach(request) assert.NoError(t, err) expectedURL := "http://" + testAddr + "/attach/" assert.Contains(t, resp.Url, expectedURL) token := strings.TrimPrefix(resp.Url, expectedURL) assertRequestToken(request, serv.(*server).cache, token) } { // TLS resp, err := tlsServer.GetAttach(request) assert.NoError(t, err) expectedURL := "https://" + testAddr + "/attach/" assert.Contains(t, resp.Url, expectedURL) token := strings.TrimPrefix(resp.Url, expectedURL) assertRequestToken(request, tlsServer.(*server).cache, token) } } func TestGetPortForward(t *testing.T) { podSandboxID := testPodSandboxID request := &runtimeapi.PortForwardRequest{ PodSandboxId: podSandboxID, Port: []int32{1, 2, 3, 4}, } { // Non-TLS serv, err := NewServer(Config{ Addr: testAddr, }, nil) assert.NoError(t, err) resp, err := serv.GetPortForward(request) assert.NoError(t, err) expectedURL := "http://" + testAddr + "/portforward/" assert.True(t, strings.HasPrefix(resp.Url, expectedURL)) token := strings.TrimPrefix(resp.Url, expectedURL) req, ok := serv.(*server).cache.Consume(token) require.True(t, ok, "token %s not found!", token) assert.Equal(t, testPodSandboxID, req.(*runtimeapi.PortForwardRequest).PodSandboxId) } { // TLS tlsServer, err := NewServer(Config{ Addr: testAddr, TLSConfig: &tls.Config{}, }, nil) assert.NoError(t, err) resp, err := tlsServer.GetPortForward(request) assert.NoError(t, err) expectedURL := "https://" + testAddr + "/portforward/" assert.True(t, strings.HasPrefix(resp.Url, expectedURL)) token := strings.TrimPrefix(resp.Url, expectedURL) req, ok := tlsServer.(*server).cache.Consume(token) require.True(t, ok, "token %s not found!", token) assert.Equal(t, testPodSandboxID, req.(*runtimeapi.PortForwardRequest).PodSandboxId) } } func TestServeExec(t *testing.T) { runRemoteCommandTest(t, "exec") } func TestServeAttach(t *testing.T) { runRemoteCommandTest(t, "attach") } func TestServePortForward(t *testing.T) { s, testServer := startTestServer(t) defer testServer.Close() resp, err := s.GetPortForward(&runtimeapi.PortForwardRequest{ PodSandboxId: testPodSandboxID, }) require.NoError(t, err) reqURL, err := url.Parse(resp.Url) require.NoError(t, err) transport, upgrader, err := spdy.RoundTripperFor(&restclient.Config{}) require.NoError(t, err) dialer := spdy.NewDialer(upgrader, &http.Client{Transport: transport}, "POST", reqURL) streamConn, _, err := dialer.Dial(kubeletportforward.ProtocolV1Name) require.NoError(t, err) defer streamConn.Close() // Create the streams. headers := http.Header{} // Error stream is required, but unused in this test. headers.Set(api.StreamType, api.StreamTypeError) headers.Set(api.PortHeader, strconv.Itoa(testPort)) _, err = streamConn.CreateStream(headers) require.NoError(t, err) // Setup the data stream. headers.Set(api.StreamType, api.StreamTypeData) headers.Set(api.PortHeader, strconv.Itoa(testPort)) stream, err := streamConn.CreateStream(headers) require.NoError(t, err) doClientStreams(t, "portforward", stream, stream, nil) } // Run the remote command test. // commandType is either "exec" or "attach". func runRemoteCommandTest(t *testing.T, commandType string) { s, testServer := startTestServer(t) defer testServer.Close() var reqURL *url.URL stdin, stdout, stderr := true, true, true containerID := testContainerID switch commandType { case "exec": resp, err := s.GetExec(&runtimeapi.ExecRequest{ ContainerId: containerID, Cmd: []string{"echo"}, Stdin: stdin, Stdout: stdout, Stderr: stderr, }) require.NoError(t, err) reqURL, err = url.Parse(resp.Url) require.NoError(t, err) case "attach": resp, err := s.GetAttach(&runtimeapi.AttachRequest{ ContainerId: containerID, Stdin: stdin, Stdout: stdout, Stderr: stderr, }) require.NoError(t, err) reqURL, err = url.Parse(resp.Url) require.NoError(t, err) } wg := sync.WaitGroup{} wg.Add(2) stdinR, stdinW := io.Pipe() stdoutR, stdoutW := io.Pipe() stderrR, stderrW := io.Pipe() go func() { defer wg.Done() exec, err := remotecommand.NewSPDYExecutor(&restclient.Config{}, "POST", reqURL) require.NoError(t, err) opts := remotecommand.StreamOptions{ Stdin: stdinR, Stdout: stdoutW, Stderr: stderrW, Tty: false, } require.NoError(t, exec.StreamWithContext(context.Background(), opts)) }() go func() { defer wg.Done() doClientStreams(t, commandType, stdinW, stdoutR, stderrR) }() wg.Wait() // Repeat request with the same URL should be a 404. resp, err := http.Get(reqURL.String()) require.NoError(t, err) assert.Equal(t, http.StatusNotFound, resp.StatusCode) } func startTestServer(t *testing.T) (Server, *httptest.Server) { var s Server testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { s.ServeHTTP(w, r) })) cleanup := true defer func() { if cleanup { testServer.Close() } }() testURL, err := url.Parse(testServer.URL) require.NoError(t, err) rt := newFakeRuntime(t) config := DefaultConfig config.BaseURL = testURL s, err = NewServer(config, rt) require.NoError(t, err) cleanup = false // Caller must close the test server. return s, testServer } const ( testInput = "abcdefg" testOutput = "fooBARbaz" testErr = "ERROR!!!" testPort = 12345 ) func newFakeRuntime(t *testing.T) *fakeRuntime { return &fakeRuntime{ t: t, } } type fakeRuntime struct { t *testing.T } func (f *fakeRuntime) Exec(_ context.Context, containerID string, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error { assert.Equal(f.t, testContainerID, containerID) doServerStreams(f.t, "exec", stdin, stdout, stderr) return nil } func (f *fakeRuntime) Attach(_ context.Context, containerID string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error { assert.Equal(f.t, testContainerID, containerID) doServerStreams(f.t, "attach", stdin, stdout, stderr) return nil } func (f *fakeRuntime) PortForward(_ context.Context, podSandboxID string, port int32, stream io.ReadWriteCloser) error { assert.Equal(f.t, testPodSandboxID, podSandboxID) assert.EqualValues(f.t, testPort, port) doServerStreams(f.t, "portforward", stream, stream, nil) return nil } // Send & receive expected input/output. Must be the inverse of doClientStreams. // Function will block until the expected i/o is finished. func doServerStreams(t *testing.T, prefix string, stdin io.Reader, stdout, stderr io.Writer) { if stderr != nil { writeExpected(t, "server stderr", stderr, prefix+testErr) } readExpected(t, "server stdin", stdin, prefix+testInput) writeExpected(t, "server stdout", stdout, prefix+testOutput) } // Send & receive expected input/output. Must be the inverse of doServerStreams. // Function will block until the expected i/o is finished. func doClientStreams(t *testing.T, prefix string, stdin io.Writer, stdout, stderr io.Reader) { if stderr != nil { readExpected(t, "client stderr", stderr, prefix+testErr) } writeExpected(t, "client stdin", stdin, prefix+testInput) readExpected(t, "client stdout", stdout, prefix+testOutput) } // Read and verify the expected string from the stream. func readExpected(t *testing.T, streamName string, r io.Reader, expected string) { result := make([]byte, len(expected)) _, err := io.ReadAtLeast(r, result, len(expected)) assert.NoError(t, err, "stream %s", streamName) assert.Equal(t, expected, string(result), "stream %s", streamName) } // Write and verify success of the data over the stream. func writeExpected(t *testing.T, streamName string, w io.Writer, data string) { n, err := io.WriteString(w, data) assert.NoError(t, err, "stream %s", streamName) assert.Equal(t, len(data), n, "stream %s", streamName) } kubelet-kubernetes-1.32.7/pkg/types/000077500000000000000000000000001503561374700173445ustar00rootroot00000000000000kubelet-kubernetes-1.32.7/pkg/types/labels.go000066400000000000000000000032441503561374700211400ustar00rootroot00000000000000/* Copyright 2016 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 types // Label keys for labels used in this package. const ( KubernetesPodNameLabel = "io.kubernetes.pod.name" KubernetesPodNamespaceLabel = "io.kubernetes.pod.namespace" KubernetesPodUIDLabel = "io.kubernetes.pod.uid" KubernetesContainerNameLabel = "io.kubernetes.container.name" ) // Label value constants const ( // PodInfraContainerName is the KubernetesPodNameLabel value for infra // containers. PodInfraContainerName = "POD" ) // GetContainerName returns the value of the KubernetesContainerNameLabel. func GetContainerName(labels map[string]string) string { return labels[KubernetesContainerNameLabel] } // GetPodName returns the value of the KubernetesPodNameLabel. func GetPodName(labels map[string]string) string { return labels[KubernetesPodNameLabel] } // GetPodUID returns the value of the KubernetesPodUIDLabel. func GetPodUID(labels map[string]string) string { return labels[KubernetesPodUIDLabel] } // GetPodNamespace returns the value of the KubernetesPodNamespaceLabel. func GetPodNamespace(labels map[string]string) string { return labels[KubernetesPodNamespaceLabel] } kubelet-kubernetes-1.32.7/pkg/types/labels_test.go000066400000000000000000000046411503561374700222010ustar00rootroot00000000000000/* Copyright 2017 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 types import ( "testing" "github.com/stretchr/testify/assert" ) func TestGetContainerName(t *testing.T) { var cases = []struct { labels map[string]string containerName string }{ { labels: map[string]string{ "io.kubernetes.container.name": "c1", }, containerName: "c1", }, { labels: map[string]string{ "io.kubernetes.container.name": "c2", }, containerName: "c2", }, } for _, data := range cases { containerName := GetContainerName(data.labels) assert.Equal(t, data.containerName, containerName) } } func TestGetPodName(t *testing.T) { var cases = []struct { labels map[string]string podName string }{ { labels: map[string]string{ "io.kubernetes.pod.name": "p1", }, podName: "p1", }, { labels: map[string]string{ "io.kubernetes.pod.name": "p2", }, podName: "p2", }, } for _, data := range cases { podName := GetPodName(data.labels) assert.Equal(t, data.podName, podName) } } func TestGetPodUID(t *testing.T) { var cases = []struct { labels map[string]string podUID string }{ { labels: map[string]string{ "io.kubernetes.pod.uid": "uid1", }, podUID: "uid1", }, { labels: map[string]string{ "io.kubernetes.pod.uid": "uid2", }, podUID: "uid2", }, } for _, data := range cases { podUID := GetPodUID(data.labels) assert.Equal(t, data.podUID, podUID) } } func TestGetPodNamespace(t *testing.T) { var cases = []struct { labels map[string]string podNamespace string }{ { labels: map[string]string{ "io.kubernetes.pod.namespace": "ns1", }, podNamespace: "ns1", }, { labels: map[string]string{ "io.kubernetes.pod.namespace": "ns2", }, podNamespace: "ns2", }, } for _, data := range cases { podNamespace := GetPodNamespace(data.labels) assert.Equal(t, data.podNamespace, podNamespace) } }