Allow specifying resource requirements in docker-compose service labels #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goals / Usage:
Specified as service labels in lagoon project yml:
Changes:
Resources
type to contain memory/cpu resources/requestsResources
toServiceValues
(BuildValues
templating input now may store resources per service)composeToServiceValues
to read service labels to set resources inServiceValues
GenerateDeploymentTemplate
To override resource requirements on container spec if present inServicValues
Tests added
The tests are a bit rough and possibly hard to grok (copy and pasted from similar and tweaked to test this functionality. But what I tried to cover:
ServiceType
resource values are used if not overriddenServiceValue.Resources
overridesBuildValues.Resources
(if overrides are set)ServiceValues
correctlyBuildValues/ServiceValues