Merge pull request #128407 from ndixita/pod-level-resources

[PodLevelResources] Pod Level Resources Feature Alpha

Kubernetes-commit: c25f5eefe4efda4c0d9561d06942cd3de3dfe2e4
This commit is contained in:
Kubernetes Publisher 2024-11-08 07:10:50 +00:00
commit 955401ca9a
4 changed files with 15 additions and 3 deletions

View File

@ -64,6 +64,7 @@ type PodSpecApplyConfiguration struct {
HostUsers *bool `json:"hostUsers,omitempty"`
SchedulingGates []PodSchedulingGateApplyConfiguration `json:"schedulingGates,omitempty"`
ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"`
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
}
// PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with
@ -444,3 +445,11 @@ func (b *PodSpecApplyConfiguration) WithResourceClaims(values ...*PodResourceCla
}
return b
}
// WithResources sets the Resources 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 Resources field is set to the value of the last call.
func (b *PodSpecApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *PodSpecApplyConfiguration {
b.Resources = value
return b
}

View File

@ -7167,6 +7167,9 @@ var schemaYAML = typed.YAMLObject(`types:
elementRelationship: associative
keys:
- name
- name: resources
type:
namedType: io.k8s.api.core.v1.ResourceRequirements
- name: restartPolicy
type:
scalar: string

2
go.mod
View File

@ -26,7 +26,7 @@ require (
golang.org/x/time v0.7.0
google.golang.org/protobuf v1.35.1
gopkg.in/evanphx/json-patch.v4 v4.12.0
k8s.io/api v0.0.0-20241108114317-84e0db8d2082
k8s.io/api v0.0.0-20241108114318-6cc44b8953ae
k8s.io/apimachinery v0.0.0-20241108022104-96b97de8d6ba
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f

4
go.sum
View File

@ -150,8 +150,8 @@ gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20241108114317-84e0db8d2082 h1:+274BvdaecJp+9jpH7KQBtzsLkqx6wqgjJhxB9mAGwA=
k8s.io/api v0.0.0-20241108114317-84e0db8d2082/go.mod h1:jw6pQTESH9mdZL2vOK3twojvpPxipl5TpLZpPyl5ZYU=
k8s.io/api v0.0.0-20241108114318-6cc44b8953ae h1:XX7vEVBchw0xx4YJZ6OyPxOq3e5hX2PTZ5wu8dw0vco=
k8s.io/api v0.0.0-20241108114318-6cc44b8953ae/go.mod h1:jw6pQTESH9mdZL2vOK3twojvpPxipl5TpLZpPyl5ZYU=
k8s.io/apimachinery v0.0.0-20241108022104-96b97de8d6ba h1:ghB5Iygt6Ge8UyIwW7C1kJx4kP7AUTCL9Qg6GCsUUOY=
k8s.io/apimachinery v0.0.0-20241108022104-96b97de8d6ba/go.mod h1:HqhdaJUgQqky29T1V0o2yFkt/pZqLFIDyn9Zi/8rxoY=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=