Upgrade the operator to use Operator SDK v1.33.0 (#182)

* Move controller package inside internal directory

Based on the go/v4 project structure, the following changed:
- Pakcage `controllers` is now named `controller`
- Package `controller` now lives inside new `internal` directory

* Move main.go in cmd directory

Based on the new go/v4 project structure, `main.go` now lives in the `cmd` directory.

* Change package import in main.go

* Update go mod dependencies

Update the dependencies based on the versions obtained by creating a new operator project using `kubebuilder init --domain onepassword.com --plugins=go/v4`.

This is based on the migration steps provided to go from go/v3 to go/v4 (https://book.kubebuilder.io/migration/migration_guide_gov3_to_gov4)

* Update vendor

* Adjust code for breaking changes from pkg update

sigs.k8s.io/controller-runtime package had breaking changes from v0.14.5 to v0.16.3. This commit brings the changes needed to achieve the same things using the new functionality avaialble.

* Adjust paths to connect yaml files

Since `main.go` is now in `cmd` directory, the paths to the files for deploying Connect have to be adjusted based on the new location `main.go` is executed from.

* Update files based on new structure and scaffolding

These changes are made based on the new project structure and scaffolding obtained when using the new go/v4 project structure.

These were done based on the migration steps mentioned when migrating to go/v4 (https://book.kubebuilder.io/migration/migration_guide_gov3_to_gov4).

* Update config files

These updates are made based on the Kustomize v4 syntax.

This is part of the upgrate to go/v4 (https://book.kubebuilder.io/migration/migration_guide_gov3_to_gov4)

* Update dependencies and GO version

* Update vendor

* Update Kubernetes tools versions

* Update operator version in Makefile

Now the version in the Makefile matches the version of the operator

* Update Operator SDK version in version.go

* Adjust generated deepcopy

It seems that the +build tag is no longer needed based on the latest generated scaffolding, therefore it's removed.

* Update copyright year

* Bring back missing changes from migration

Some customization in Makefile was lost during the migration process. Specifically, the namespace customization for `make deploy` command.

Also, we push changes to kustomization.yaml for making the deploy process smoother.

* Add RBAC perms for coordination.k8s.io

It seems that with the latest changes to Kubernetes and Kustomize, we need to add additional RBAC to the service account used so that it can properly access the `leases` resource.

* Optimize Dockerfile

Dockerfile had a step for caching dependencies (go mod download). However, this is already done by the vendor directory, which we include. Therefore, this step can be removed to make the image build time faster.
This commit is contained in:
Eduard Filip
2024-01-25 14:21:31 +01:00
committed by GitHub
parent 8fc852a4dd
commit f72e5243b0
1356 changed files with 86780 additions and 43671 deletions

View File

@@ -20,5 +20,5 @@ limitations under the License.
// +groupName=resource.k8s.io
// Package v1alpha1 is the v1alpha1 version of the resource API.
package v1alpha1 // import "k8s.io/api/resource/v1alpha1"
// Package v1alpha2 is the v1alpha2 version of the resource API.
package v1alpha2 // import "k8s.io/api/resource/v1alpha2"

View File

@@ -19,7 +19,7 @@ limitations under the License.
syntax = "proto2";
package k8s.io.api.resource.v1alpha1;
package k8s.io.api.resource.v1alpha2;
import "k8s.io/api/core/v1/generated.proto";
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
@@ -27,23 +27,30 @@ import "k8s.io/apimachinery/pkg/runtime/generated.proto";
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
// Package-wide variables from generator "generated".
option go_package = "k8s.io/api/resource/v1alpha1";
option go_package = "k8s.io/api/resource/v1alpha2";
// AllocationResult contains attributed of an allocated resource.
// AllocationResult contains attributes of an allocated resource.
message AllocationResult {
// ResourceHandle contains arbitrary data returned by the driver after a
// successful allocation. This is opaque for
// Kubernetes. Driver documentation may explain to users how to
// interpret this data if needed.
// ResourceHandles contain the state associated with an allocation that
// should be maintained throughout the lifetime of a claim. Each
// ResourceHandle contains data that should be passed to a specific kubelet
// plugin once it lands on a node. This data is returned by the driver
// after a successful allocation and is opaque to Kubernetes. Driver
// documentation may explain to users how to interpret this data if needed.
//
// The maximum size of this field is 16KiB. This may get
// increased in the future, but not reduced.
// Setting this field is optional. It has a maximum size of 32 entries.
// If null (or empty), it is assumed this allocation will be processed by a
// single kubelet plugin with no ResourceHandle data attached. The name of
// the kubelet plugin invoked will match the DriverName set in the
// ResourceClaimStatus this AllocationResult is embedded in.
//
// +listType=atomic
// +optional
optional string resourceHandle = 1;
repeated ResourceHandle resourceHandles = 1;
// This field will get set by the resource driver after it has
// allocated the resource driver to inform the scheduler where it can
// schedule Pods using the ResourceClaim.
// This field will get set by the resource driver after it has allocated
// the resource to inform the scheduler where it can schedule Pods using
// the ResourceClaim.
//
// Setting this field is optional. If null, the resource is available
// everywhere.
@@ -56,37 +63,37 @@ message AllocationResult {
optional bool shareable = 3;
}
// PodScheduling objects hold information that is needed to schedule
// PodSchedulingContext objects hold information that is needed to schedule
// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
// mode.
//
// This is an alpha type and requires enabling the DynamicResourceAllocation
// feature gate.
message PodScheduling {
message PodSchedulingContext {
// Standard object metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
// Spec describes where resources for the Pod are needed.
optional PodSchedulingSpec spec = 2;
optional PodSchedulingContextSpec spec = 2;
// Status describes where resources for the Pod can be allocated.
// +optional
optional PodSchedulingStatus status = 3;
optional PodSchedulingContextStatus status = 3;
}
// PodSchedulingList is a collection of Pod scheduling objects.
message PodSchedulingList {
// PodSchedulingContextList is a collection of Pod scheduling objects.
message PodSchedulingContextList {
// Standard list metadata
// +optional
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
// Items is the list of PodScheduling objects.
repeated PodScheduling items = 2;
// Items is the list of PodSchedulingContext objects.
repeated PodSchedulingContext items = 2;
}
// PodSchedulingSpec describes where resources for the Pod are needed.
message PodSchedulingSpec {
// PodSchedulingContextSpec describes where resources for the Pod are needed.
message PodSchedulingContextSpec {
// SelectedNode is the node for which allocation of ResourceClaims that
// are referenced by the Pod and that use "WaitForFirstConsumer"
// allocation is to be attempted.
@@ -100,13 +107,13 @@ message PodSchedulingSpec {
// that suits all pending resources. This may get increased in the
// future, but not reduced.
//
// +listType=set
// +listType=atomic
// +optional
repeated string potentialNodes = 2;
}
// PodSchedulingStatus describes where resources for the Pod can be allocated.
message PodSchedulingStatus {
// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
message PodSchedulingContextStatus {
// ResourceClaims describes resource availability for each
// pod.spec.resourceClaim entry where the corresponding ResourceClaim
// uses "WaitForFirstConsumer" allocation mode.
@@ -201,7 +208,7 @@ message ResourceClaimSchedulingStatus {
// PodSchedulingSpec.PotentialNodes. This may get increased in the
// future, but not reduced.
//
// +listType=set
// +listType=atomic
// +optional
repeated string unsuitableNodes = 2;
}
@@ -235,9 +242,9 @@ message ResourceClaimStatus {
// +optional
optional string driverName = 1;
// Allocation is set by the resource driver once a resource has been
// allocated successfully. If this is not specified, the resource is
// not yet allocated.
// Allocation is set by the resource driver once a resource or set of
// resources has been allocated successfully. If this is not specified, the
// resources have not been allocated yet.
// +optional
optional AllocationResult allocation = 2;
@@ -370,3 +377,24 @@ message ResourceClassParametersReference {
optional string namespace = 4;
}
// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.
message ResourceHandle {
// DriverName specifies the name of the resource driver whose kubelet
// plugin should be invoked to process this ResourceHandle's data once it
// lands on a node. This may differ from the DriverName set in
// ResourceClaimStatus this ResourceHandle is embedded in.
optional string driverName = 1;
// Data contains the opaque data associated with this ResourceHandle. It is
// set by the controller component of the resource driver whose name
// matches the DriverName set in the ResourceClaimStatus this
// ResourceHandle is embedded in. It is set at allocation time and is
// intended for processing by the kubelet plugin whose name matches
// the DriverName set in this ResourceHandle.
//
// The maximum size of this field is 16KiB. This may get increased in the
// future, but not reduced.
// +optional
optional string data = 2;
}

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -26,7 +26,7 @@ import (
const GroupName = "resource.k8s.io"
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha2"}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
@@ -50,8 +50,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&ResourceClaimList{},
&ResourceClaimTemplate{},
&ResourceClaimTemplateList{},
&PodScheduling{},
&PodSchedulingList{},
&PodSchedulingContext{},
&PodSchedulingContextList{},
)
// Add common types

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
import (
v1 "k8s.io/api/core/v1"
@@ -99,9 +99,9 @@ type ResourceClaimStatus struct {
// +optional
DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
// Allocation is set by the resource driver once a resource has been
// allocated successfully. If this is not specified, the resource is
// not yet allocated.
// Allocation is set by the resource driver once a resource or set of
// resources has been allocated successfully. If this is not specified, the
// resources have not been allocated yet.
// +optional
Allocation *AllocationResult `json:"allocation,omitempty" protobuf:"bytes,2,opt,name=allocation"`
@@ -133,21 +133,28 @@ type ResourceClaimStatus struct {
// claim.status.reservedFor.
const ResourceClaimReservedForMaxSize = 32
// AllocationResult contains attributed of an allocated resource.
// AllocationResult contains attributes of an allocated resource.
type AllocationResult struct {
// ResourceHandle contains arbitrary data returned by the driver after a
// successful allocation. This is opaque for
// Kubernetes. Driver documentation may explain to users how to
// interpret this data if needed.
// ResourceHandles contain the state associated with an allocation that
// should be maintained throughout the lifetime of a claim. Each
// ResourceHandle contains data that should be passed to a specific kubelet
// plugin once it lands on a node. This data is returned by the driver
// after a successful allocation and is opaque to Kubernetes. Driver
// documentation may explain to users how to interpret this data if needed.
//
// The maximum size of this field is 16KiB. This may get
// increased in the future, but not reduced.
// Setting this field is optional. It has a maximum size of 32 entries.
// If null (or empty), it is assumed this allocation will be processed by a
// single kubelet plugin with no ResourceHandle data attached. The name of
// the kubelet plugin invoked will match the DriverName set in the
// ResourceClaimStatus this AllocationResult is embedded in.
//
// +listType=atomic
// +optional
ResourceHandle string `json:"resourceHandle,omitempty" protobuf:"bytes,1,opt,name=resourceHandle"`
ResourceHandles []ResourceHandle `json:"resourceHandles,omitempty" protobuf:"bytes,1,opt,name=resourceHandles"`
// This field will get set by the resource driver after it has
// allocated the resource driver to inform the scheduler where it can
// schedule Pods using the ResourceClaim.
// This field will get set by the resource driver after it has allocated
// the resource to inform the scheduler where it can schedule Pods using
// the ResourceClaim.
//
// Setting this field is optional. If null, the resource is available
// everywhere.
@@ -160,8 +167,33 @@ type AllocationResult struct {
Shareable bool `json:"shareable,omitempty" protobuf:"varint,3,opt,name=shareable"`
}
// ResourceHandleMaxSize is the maximum size of allocation.resourceHandle.
const ResourceHandleMaxSize = 16 * 1024
// AllocationResultResourceHandlesMaxSize represents the maximum number of
// entries in allocation.resourceHandles.
const AllocationResultResourceHandlesMaxSize = 32
// ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.
type ResourceHandle struct {
// DriverName specifies the name of the resource driver whose kubelet
// plugin should be invoked to process this ResourceHandle's data once it
// lands on a node. This may differ from the DriverName set in
// ResourceClaimStatus this ResourceHandle is embedded in.
DriverName string `json:"driverName,omitempty" protobuf:"bytes,1,opt,name=driverName"`
// Data contains the opaque data associated with this ResourceHandle. It is
// set by the controller component of the resource driver whose name
// matches the DriverName set in the ResourceClaimStatus this
// ResourceHandle is embedded in. It is set at allocation time and is
// intended for processing by the kubelet plugin whose name matches
// the DriverName set in this ResourceHandle.
//
// The maximum size of this field is 16KiB. This may get increased in the
// future, but not reduced.
// +optional
Data string `json:"data,omitempty" protobuf:"bytes,2,opt,name=data"`
}
// ResourceHandleDataMaxSize represents the maximum size of resourceHandle.data.
const ResourceHandleDataMaxSize = 16 * 1024
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.26
@@ -181,28 +213,28 @@ type ResourceClaimList struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.26
// PodScheduling objects hold information that is needed to schedule
// PodSchedulingContext objects hold information that is needed to schedule
// a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation
// mode.
//
// This is an alpha type and requires enabling the DynamicResourceAllocation
// feature gate.
type PodScheduling struct {
type PodSchedulingContext struct {
metav1.TypeMeta `json:",inline"`
// Standard object metadata
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Spec describes where resources for the Pod are needed.
Spec PodSchedulingSpec `json:"spec" protobuf:"bytes,2,name=spec"`
Spec PodSchedulingContextSpec `json:"spec" protobuf:"bytes,2,name=spec"`
// Status describes where resources for the Pod can be allocated.
// +optional
Status PodSchedulingStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
Status PodSchedulingContextStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}
// PodSchedulingSpec describes where resources for the Pod are needed.
type PodSchedulingSpec struct {
// PodSchedulingContextSpec describes where resources for the Pod are needed.
type PodSchedulingContextSpec struct {
// SelectedNode is the node for which allocation of ResourceClaims that
// are referenced by the Pod and that use "WaitForFirstConsumer"
// allocation is to be attempted.
@@ -216,13 +248,13 @@ type PodSchedulingSpec struct {
// that suits all pending resources. This may get increased in the
// future, but not reduced.
//
// +listType=set
// +listType=atomic
// +optional
PotentialNodes []string `json:"potentialNodes,omitempty" protobuf:"bytes,2,opt,name=potentialNodes"`
}
// PodSchedulingStatus describes where resources for the Pod can be allocated.
type PodSchedulingStatus struct {
// PodSchedulingContextStatus describes where resources for the Pod can be allocated.
type PodSchedulingContextStatus struct {
// ResourceClaims describes resource availability for each
// pod.spec.resourceClaim entry where the corresponding ResourceClaim
// uses "WaitForFirstConsumer" allocation mode.
@@ -251,28 +283,28 @@ type ResourceClaimSchedulingStatus struct {
// PodSchedulingSpec.PotentialNodes. This may get increased in the
// future, but not reduced.
//
// +listType=set
// +listType=atomic
// +optional
UnsuitableNodes []string `json:"unsuitableNodes,omitempty" protobuf:"bytes,2,opt,name=unsuitableNodes"`
}
// PodSchedulingNodeListMaxSize defines the maximum number of entries in the
// node lists that are stored in PodScheduling objects. This limit is part
// node lists that are stored in PodSchedulingContext objects. This limit is part
// of the API.
const PodSchedulingNodeListMaxSize = 128
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:prerelease-lifecycle-gen:introduced=1.26
// PodSchedulingList is a collection of Pod scheduling objects.
type PodSchedulingList struct {
// PodSchedulingContextList is a collection of Pod scheduling objects.
type PodSchedulingContextList struct {
metav1.TypeMeta `json:",inline"`
// Standard list metadata
// +optional
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
// Items is the list of PodScheduling objects.
Items []PodScheduling `json:"items" protobuf:"bytes,2,rep,name=items"`
// Items is the list of PodSchedulingContext objects.
Items []PodSchedulingContext `json:"items" protobuf:"bytes,2,rep,name=items"`
}
// +genclient

View File

@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package v1alpha1
package v1alpha2
// This file contains a collection of methods that can be used from go-restful to
// generate Swagger API documentation for its models. Please read this PR for more
@@ -24,13 +24,13 @@ package v1alpha1
// they are on one line! For multiple line or blocks that you want to ignore use ---.
// Any context after a --- is ignored.
//
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
// Those methods can be generated by using hack/update-codegen.sh
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
var map_AllocationResult = map[string]string{
"": "AllocationResult contains attributed of an allocated resource.",
"resourceHandle": "ResourceHandle contains arbitrary data returned by the driver after a successful allocation. This is opaque for Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.",
"availableOnNodes": "This field will get set by the resource driver after it has allocated the resource driver to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere.",
"": "AllocationResult contains attributes of an allocated resource.",
"resourceHandles": "ResourceHandles contain the state associated with an allocation that should be maintained throughout the lifetime of a claim. Each ResourceHandle contains data that should be passed to a specific kubelet plugin once it lands on a node. This data is returned by the driver after a successful allocation and is opaque to Kubernetes. Driver documentation may explain to users how to interpret this data if needed.\n\nSetting this field is optional. It has a maximum size of 32 entries. If null (or empty), it is assumed this allocation will be processed by a single kubelet plugin with no ResourceHandle data attached. The name of the kubelet plugin invoked will match the DriverName set in the ResourceClaimStatus this AllocationResult is embedded in.",
"availableOnNodes": "This field will get set by the resource driver after it has allocated the resource to inform the scheduler where it can schedule Pods using the ResourceClaim.\n\nSetting this field is optional. If null, the resource is available everywhere.",
"shareable": "Shareable determines whether the resource supports more than one consumer at a time.",
}
@@ -38,44 +38,44 @@ func (AllocationResult) SwaggerDoc() map[string]string {
return map_AllocationResult
}
var map_PodScheduling = map[string]string{
"": "PodScheduling objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
var map_PodSchedulingContext = map[string]string{
"": "PodSchedulingContext objects hold information that is needed to schedule a Pod with ResourceClaims that use \"WaitForFirstConsumer\" allocation mode.\n\nThis is an alpha type and requires enabling the DynamicResourceAllocation feature gate.",
"metadata": "Standard object metadata",
"spec": "Spec describes where resources for the Pod are needed.",
"status": "Status describes where resources for the Pod can be allocated.",
}
func (PodScheduling) SwaggerDoc() map[string]string {
return map_PodScheduling
func (PodSchedulingContext) SwaggerDoc() map[string]string {
return map_PodSchedulingContext
}
var map_PodSchedulingList = map[string]string{
"": "PodSchedulingList is a collection of Pod scheduling objects.",
var map_PodSchedulingContextList = map[string]string{
"": "PodSchedulingContextList is a collection of Pod scheduling objects.",
"metadata": "Standard list metadata",
"items": "Items is the list of PodScheduling objects.",
"items": "Items is the list of PodSchedulingContext objects.",
}
func (PodSchedulingList) SwaggerDoc() map[string]string {
return map_PodSchedulingList
func (PodSchedulingContextList) SwaggerDoc() map[string]string {
return map_PodSchedulingContextList
}
var map_PodSchedulingSpec = map[string]string{
"": "PodSchedulingSpec describes where resources for the Pod are needed.",
var map_PodSchedulingContextSpec = map[string]string{
"": "PodSchedulingContextSpec describes where resources for the Pod are needed.",
"selectedNode": "SelectedNode is the node for which allocation of ResourceClaims that are referenced by the Pod and that use \"WaitForFirstConsumer\" allocation is to be attempted.",
"potentialNodes": "PotentialNodes lists nodes where the Pod might be able to run.\n\nThe size of this field is limited to 128. This is large enough for many clusters. Larger clusters may need more attempts to find a node that suits all pending resources. This may get increased in the future, but not reduced.",
}
func (PodSchedulingSpec) SwaggerDoc() map[string]string {
return map_PodSchedulingSpec
func (PodSchedulingContextSpec) SwaggerDoc() map[string]string {
return map_PodSchedulingContextSpec
}
var map_PodSchedulingStatus = map[string]string{
"": "PodSchedulingStatus describes where resources for the Pod can be allocated.",
var map_PodSchedulingContextStatus = map[string]string{
"": "PodSchedulingContextStatus describes where resources for the Pod can be allocated.",
"resourceClaims": "ResourceClaims describes resource availability for each pod.spec.resourceClaim entry where the corresponding ResourceClaim uses \"WaitForFirstConsumer\" allocation mode.",
}
func (PodSchedulingStatus) SwaggerDoc() map[string]string {
return map_PodSchedulingStatus
func (PodSchedulingContextStatus) SwaggerDoc() map[string]string {
return map_PodSchedulingContextStatus
}
var map_ResourceClaim = map[string]string{
@@ -146,7 +146,7 @@ func (ResourceClaimSpec) SwaggerDoc() map[string]string {
var map_ResourceClaimStatus = map[string]string{
"": "ResourceClaimStatus tracks whether the resource has been allocated and what the resulting attributes are.",
"driverName": "DriverName is a copy of the driver name from the ResourceClass at the time when allocation started.",
"allocation": "Allocation is set by the resource driver once a resource has been allocated successfully. If this is not specified, the resource is not yet allocated.",
"allocation": "Allocation is set by the resource driver once a resource or set of resources has been allocated successfully. If this is not specified, the resources have not been allocated yet.",
"reservedFor": "ReservedFor indicates which entities are currently allowed to use the claim. A Pod which references a ResourceClaim which is not reserved for that Pod will not be started.\n\nThere can be at most 32 such reservations. This may get increased in the future, but not reduced.",
"deallocationRequested": "DeallocationRequested indicates that a ResourceClaim is to be deallocated.\n\nThe driver then must deallocate this claim and reset the field together with clearing the Allocation field.\n\nWhile DeallocationRequested is set, no new consumers may be added to ReservedFor.",
}
@@ -219,4 +219,14 @@ func (ResourceClassParametersReference) SwaggerDoc() map[string]string {
return map_ResourceClassParametersReference
}
var map_ResourceHandle = map[string]string{
"": "ResourceHandle holds opaque resource data for processing by a specific kubelet plugin.",
"driverName": "DriverName specifies the name of the resource driver whose kubelet plugin should be invoked to process this ResourceHandle's data once it lands on a node. This may differ from the DriverName set in ResourceClaimStatus this ResourceHandle is embedded in.",
"data": "Data contains the opaque data associated with this ResourceHandle. It is set by the controller component of the resource driver whose name matches the DriverName set in the ResourceClaimStatus this ResourceHandle is embedded in. It is set at allocation time and is intended for processing by the kubelet plugin whose name matches the DriverName set in this ResourceHandle.\n\nThe maximum size of this field is 16KiB. This may get increased in the future, but not reduced.",
}
func (ResourceHandle) SwaggerDoc() map[string]string {
return map_ResourceHandle
}
// AUTO-GENERATED FUNCTIONS END HERE

View File

@@ -19,7 +19,7 @@ limitations under the License.
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1alpha1
package v1alpha2
import (
v1 "k8s.io/api/core/v1"
@@ -29,6 +29,11 @@ import (
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AllocationResult) DeepCopyInto(out *AllocationResult) {
*out = *in
if in.ResourceHandles != nil {
in, out := &in.ResourceHandles, &out.ResourceHandles
*out = make([]ResourceHandle, len(*in))
copy(*out, *in)
}
if in.AvailableOnNodes != nil {
in, out := &in.AvailableOnNodes, &out.AvailableOnNodes
*out = new(v1.NodeSelector)
@@ -48,7 +53,7 @@ func (in *AllocationResult) DeepCopy() *AllocationResult {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodScheduling) DeepCopyInto(out *PodScheduling) {
func (in *PodSchedulingContext) DeepCopyInto(out *PodSchedulingContext) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
@@ -57,18 +62,18 @@ func (in *PodScheduling) DeepCopyInto(out *PodScheduling) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodScheduling.
func (in *PodScheduling) DeepCopy() *PodScheduling {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingContext.
func (in *PodSchedulingContext) DeepCopy() *PodSchedulingContext {
if in == nil {
return nil
}
out := new(PodScheduling)
out := new(PodSchedulingContext)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodScheduling) DeepCopyObject() runtime.Object {
func (in *PodSchedulingContext) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -76,13 +81,13 @@ func (in *PodScheduling) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSchedulingList) DeepCopyInto(out *PodSchedulingList) {
func (in *PodSchedulingContextList) DeepCopyInto(out *PodSchedulingContextList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]PodScheduling, len(*in))
*out = make([]PodSchedulingContext, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
@@ -90,18 +95,18 @@ func (in *PodSchedulingList) DeepCopyInto(out *PodSchedulingList) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingList.
func (in *PodSchedulingList) DeepCopy() *PodSchedulingList {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingContextList.
func (in *PodSchedulingContextList) DeepCopy() *PodSchedulingContextList {
if in == nil {
return nil
}
out := new(PodSchedulingList)
out := new(PodSchedulingContextList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodSchedulingList) DeepCopyObject() runtime.Object {
func (in *PodSchedulingContextList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
@@ -109,7 +114,7 @@ func (in *PodSchedulingList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSchedulingSpec) DeepCopyInto(out *PodSchedulingSpec) {
func (in *PodSchedulingContextSpec) DeepCopyInto(out *PodSchedulingContextSpec) {
*out = *in
if in.PotentialNodes != nil {
in, out := &in.PotentialNodes, &out.PotentialNodes
@@ -119,18 +124,18 @@ func (in *PodSchedulingSpec) DeepCopyInto(out *PodSchedulingSpec) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingSpec.
func (in *PodSchedulingSpec) DeepCopy() *PodSchedulingSpec {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingContextSpec.
func (in *PodSchedulingContextSpec) DeepCopy() *PodSchedulingContextSpec {
if in == nil {
return nil
}
out := new(PodSchedulingSpec)
out := new(PodSchedulingContextSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodSchedulingStatus) DeepCopyInto(out *PodSchedulingStatus) {
func (in *PodSchedulingContextStatus) DeepCopyInto(out *PodSchedulingContextStatus) {
*out = *in
if in.ResourceClaims != nil {
in, out := &in.ResourceClaims, &out.ResourceClaims
@@ -142,12 +147,12 @@ func (in *PodSchedulingStatus) DeepCopyInto(out *PodSchedulingStatus) {
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingStatus.
func (in *PodSchedulingStatus) DeepCopy() *PodSchedulingStatus {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodSchedulingContextStatus.
func (in *PodSchedulingContextStatus) DeepCopy() *PodSchedulingContextStatus {
if in == nil {
return nil
}
out := new(PodSchedulingStatus)
out := new(PodSchedulingContextStatus)
in.DeepCopyInto(out)
return out
}
@@ -475,3 +480,19 @@ func (in *ResourceClassParametersReference) DeepCopy() *ResourceClassParametersR
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ResourceHandle) DeepCopyInto(out *ResourceHandle) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceHandle.
func (in *ResourceHandle) DeepCopy() *ResourceHandle {
if in == nil {
return nil
}
out := new(ResourceHandle)
in.DeepCopyInto(out)
return out
}