-
Notifications
You must be signed in to change notification settings - Fork 820
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
Fix wrong condition check for Memory limit #1418
Conversation
Build Succeeded 👏 Build Id: 4804a0e6-cb18-401a-8ef3-80267e895773 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 1537306f-4af7-4a32-b821-bd7594f1e647 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
This is needed to start writing validation
7791336
to
3eab7d5
Compare
// ValidateResource validates limit or Memory CPU resources used for containers in pods | ||
// If a GameServer is invalid there will be > 0 values in | ||
// the returned array | ||
func ValidateResource(request resource.Quantity, limit resource.Quantity, resourceName corev1.ResourceName) []error { |
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.
I have placed ValidateResource() here so we will check PodTemplate in a Fleet and GameServer using exact same function.
Which is part of #1298
Build Failed 😱 Build Id: 111003dc-428c-4116-bf36-d5f43c2ada5b To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
3eab7d5
to
e88c997
Compare
Build Failed 😱 Build Id: 07cf6596-f93f-44a4-90a9-ce0f8de44c58 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Flaky #1376 . |
e88c997
to
15d07f7
Compare
Build Failed 😱 Build Id: c2508e45-a672-477f-af41-96d77f021c72 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Add test function for Agones Controller validate function. Function ValidateResource() would be reused for Fleet PodTemplate Resources validation.
15d07f7
to
961a2c4
Compare
Build Succeeded 👏 Build Id: c8113db5-2554-4a86-83b7-f2fb1eab111c The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
if c.MinPort <= 0 || c.MaxPort <= 0 { | ||
return errors.New("min Port and Max Port values are required") | ||
validationErrors = append(validationErrors, errors.New("min Port and Max Port values are required")) |
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.
Love this. 👍
New changes are detected. LGTM label has been removed. |
found := false | ||
for _, v := range errs { | ||
if expected == v.Error() { | ||
found = true |
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.
We can safely break the loop here because there is no point to check other elements of the slice
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.
Added break
Build Succeeded 👏 Build Id: f5047ddc-e182-4430-91be-e06b0f5c4258 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akremsa, aLekSer, markmandel 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 |
@akremsa: changing LGTM is restricted to collaborators 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. |
Build Succeeded 👏 Build Id: e64dd6d2-ad74-483f-9e67-7454387f1ef3 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
* Fix wrong condition check for Memory limit * Add a function to validate Resource config Add test function for Agones Controller validate function. Function ValidateResource() would be reused for Fleet, GSS and GS PodTemplate CPU and Memory Resources validation.
This is needed to start writing validation for these new limits as well as CPU ones.
Closes #1419.