/* 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 applyconfiguration-gen. DO NOT EDIT. package v1 import ( corev1 "k8s.io/api/core/v1" resource "k8s.io/apimachinery/pkg/api/resource" ) // NodeAllocatableResourceClaimStatusApplyConfiguration represents a declarative configuration of the NodeAllocatableResourceClaimStatus type for use // with apply. // // NodeAllocatableResourceClaimStatus describes the status of node allocatable resources allocated via DRA. type NodeAllocatableResourceClaimStatusApplyConfiguration struct { // ResourceClaimName is the resource claim referenced by the pod that resulted in this node allocatable resource allocation. ResourceClaimName *string `json:"resourceClaimName,omitempty"` // Containers lists the names of all containers in this pod that reference the claim. Containers []string `json:"containers,omitempty"` // Resources is a map of the node-allocatable resource name to the aggregate quantity allocated to the claim. Resources map[corev1.ResourceName]resource.Quantity `json:"resources,omitempty"` } // NodeAllocatableResourceClaimStatusApplyConfiguration constructs a declarative configuration of the NodeAllocatableResourceClaimStatus type for use with // apply. func NodeAllocatableResourceClaimStatus() *NodeAllocatableResourceClaimStatusApplyConfiguration { return &NodeAllocatableResourceClaimStatusApplyConfiguration{} } // WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the ResourceClaimName field is set to the value of the last call. func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *NodeAllocatableResourceClaimStatusApplyConfiguration { b.ResourceClaimName = &value return b } // WithContainers adds the given value to the Containers field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, values provided by each call will be appended to the Containers field. func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithContainers(values ...string) *NodeAllocatableResourceClaimStatusApplyConfiguration { for i := range values { b.Containers = append(b.Containers, values[i]) } return b } // WithResources puts the entries into the Resources field in the declarative configuration // and returns the receiver, so that objects can be build by chaining "With" function invocations. // If called multiple times, the entries provided by each call will be put on the Resources field, // overwriting an existing map entries in Resources field with the same key. func (b *NodeAllocatableResourceClaimStatusApplyConfiguration) WithResources(entries map[corev1.ResourceName]resource.Quantity) *NodeAllocatableResourceClaimStatusApplyConfiguration { if b.Resources == nil && len(entries) > 0 { b.Resources = make(map[corev1.ResourceName]resource.Quantity, len(entries)) } for k, v := range entries { b.Resources[k] = v } return b }