Skip to content

Commit

Permalink
Merge pull request #6251 from voelzmo/fix/evictionRequirements-in-crd
Browse files Browse the repository at this point in the history
Fix '.spec.updatePolicy.evictionRequirements.resources' to be plural in yaml
  • Loading branch information
k8s-ci-robot authored Nov 22, 2023
2 parents 39245a5 + 383337e commit 8673628
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,11 @@ spec:
resourcePolicy:
description: Controls how the autoscaler computes recommended resources.
The resource policy may be used to set constraints on the recommendations
for individual containers. If not specified, the autoscaler computes
recommended resources for all containers in the pod, without additional
constraints.
for individual containers. If any individual containers need to
be excluded from getting the VPA recommendations, then it must be
disabled explicitly by setting mode to "Off" under containerPolicies.
If not specified, the autoscaler computes recommended resources
for all containers in the pod, without additional constraints.
properties:
containerPolicies:
description: Per-container resource policies.
Expand Down Expand Up @@ -397,7 +399,7 @@ spec:
- TargetHigherThanRequests
- TargetLowerThanRequests
type: string
resource:
resources:
description: Resources is a list of one or more resources
that the condition applies to. If more than one resource
is given, the EvictionRequirement is fulfilled if at least
Expand All @@ -409,7 +411,7 @@ spec:
type: array
required:
- changeRequirement
- resource
- resources
type: object
type: array
minReplicas:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A single `EvictionRequirement` specifies `Resources` and a `ChangeRequirement` c

Add validation to prevent users from adding `EvictionRequirements` which can never evaluate to `true`:
* Reject if more than one `EvictionRequirement` for a single resource is found
* Reject if `Resource: [CPU, Memory]` is specified on one `EvictionRequirement` together with `Resource: [CPU]` or `Resource: [Memory]` on another `EvictionRequirement`
* Reject if `Resources: [CPU, Memory]` is specified on one `EvictionRequirement` together with `Resources: [CPU]` or `Resources: [Memory]` on another `EvictionRequirement`

## Design Details
### Test Plan
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type EvictionRequirement struct {
// Resources is a list of one or more resources that the condition applies
// to. If more than one resource is given, the EvictionRequirement is fulfilled
// if at least one resource meets `changeRequirement`.
Resources []v1.ResourceName `json:"resource" protobuf:"bytes,1,name=resources"`
Resources []v1.ResourceName `json:"resources" protobuf:"bytes,1,name=resources"`
ChangeRequirement EvictionChangeRequirement `json:"changeRequirement" protobuf:"bytes,2,name=changeRequirement"`
}

Expand Down

0 comments on commit 8673628

Please sign in to comment.