Skip to content
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

Merged
merged 1 commit into from
Aug 22, 2019

Conversation

jcpowermac
Copy link
Contributor

  • 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.

@openshift-ci-robot
Copy link
Contributor

@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:

Bug 1726455: Reconcile container limits in resource merge

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.

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 20, 2019
@@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abhinavdahiya ok will update.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 20, 2019
@jcpowermac jcpowermac changed the title Bug 1726455: Reconcile container limits in resource merge Bug 1726455: Reconcile container ResourceRequirements in resource merge Aug 20, 2019
@jcpowermac
Copy link
Contributor Author

/retest

1 similar comment
@abhinavdahiya
Copy link
Contributor

/retest

@@ -113,6 +114,100 @@ func TestEnsurePodSpec(t *testing.T) {
Containers: []corev1.Container{
corev1.Container{Name: "test"}}},
},
{
name: "remove limits and requests on container",
Copy link
Contributor

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.
},
},
{
name: "match limits and requests on container",
Copy link
Contributor Author

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

@jcpowermac
Copy link
Contributor Author

/retest

@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 21, 2019
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 21, 2019
@openshift-merge-robot openshift-merge-robot merged commit df38364 into openshift:master Aug 22, 2019
@openshift-ci-robot
Copy link
Contributor

@jcpowermac: All pull requests linked via external trackers have merged. Bugzilla bug 1726455 has been moved to the MODIFIED state.

In response to this:

Bug 1726455: Reconcile container ResourceRequirements in resource merge

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants