-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1726455: Reconcile container ResourceRequirements in resource merge #240
Bug 1726455: Reconcile container ResourceRequirements in resource merge #240
Conversation
@jcpowermac: This pull request references Bugzilla bug 1726455, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@@ -445,6 +446,13 @@ func ensureSELinuxOptions(modified *bool, existing *corev1.SELinuxOptions, requi | |||
setStringIfSet(modified, &existing.Level, required.Level) | |||
} | |||
|
|||
func ensureResourceRequirements(modified *bool, existing *corev1.ResourceRequirements, required corev1.ResourceRequirements) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include both https://godoc.org/k8s.io/api/core/v1#ResourceRequirements Limits
and Requests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhinavdahiya ok will update.
180910d
to
1264cbc
Compare
1264cbc
to
c8b79d6
Compare
/retest |
1 similar comment
/retest |
@@ -113,6 +114,100 @@ func TestEnsurePodSpec(t *testing.T) { | |||
Containers: []corev1.Container{ | |||
corev1.Container{Name: "test"}}}, | |||
}, | |||
{ | |||
name: "remove limits and requests on container", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add a no-op ?
- Add ensureResourceRequirements function that calls ensureResourceList for limits and requests. - Add ensureResourceList function that compares existing and required. If different deepcopy required into existing. - Update core_test to include testing container resources limits and requests addition, change and removal.
c8b79d6
to
a099549
Compare
}, | ||
}, | ||
{ | ||
name: "match limits and requests on container", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhinavdahiya added matching existing and input last night with expectedModified: false
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, jcpowermac The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@jcpowermac: All pull requests linked via external trackers have merged. Bugzilla bug 1726455 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Add ensureResourceRequirements function
If existing and required are not equal will DeepCopy required
into existing.
Update core_test to include testing container resources limits addition
and removal.