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

Fix wrong condition check for Memory limit #1418

Merged
merged 4 commits into from
Mar 24, 2020

Conversation

aLekSer
Copy link
Collaborator

@aLekSer aLekSer commented Mar 17, 2020

This is needed to start writing validation for these new limits as well as CPU ones.

Closes #1419.

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1418/head:pr_1418 && git checkout pr_1418
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-5999c5c

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1418/head:pr_1418 && git checkout pr_1418
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-7791336

This is needed to start writing validation
// 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 {
Copy link
Collaborator Author

@aLekSer aLekSer Mar 20, 2020

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 111003dc-428c-4116-bf36-d5f43c2ada5b

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 07cf6596-f93f-44a4-90a9-ce0f8de44c58

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aLekSer
Copy link
Collaborator Author

aLekSer commented Mar 20, 2020

Flaky #1376 .

@agones-bot
Copy link
Collaborator

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.
@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1418/head:pr_1418 && git checkout pr_1418
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-961a2c4

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"))
Copy link
Member

Choose a reason for hiding this comment

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

Love this. 👍

@markmandel markmandel added area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones labels Mar 23, 2020
@markmandel markmandel added this to the 1.5.0 milestone Mar 23, 2020
@google-oss-robot
Copy link

New changes are detected. LGTM label has been removed.

found := false
for _, v := range errs {
if expected == v.Error() {
found = true
Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added break

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1418/head:pr_1418 && git checkout pr_1418
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-da3a56d

@google-oss-robot
Copy link

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

@google-oss-robot
Copy link

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

@agones-bot
Copy link
Collaborator

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:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1418/head:pr_1418 && git checkout pr_1418
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.5.0-e99cd82

@aLekSer aLekSer merged commit 5a04207 into googleforgames:master Mar 24, 2020
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/user-experience Pertaining to developers trying to use Agones, e.g. SDK, installation, etc kind/feature New features for Agones size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No validation when helm parameter agones.image.sdk.cpuRequest set less than cpuLimit
5 participants