Added resources in InitContainers #652
Open
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.
This pull request adds support for specifying resource requirements (like CPU and memory limits/requests) for
InitContainer
definitions in the custom resource and ensures these requirements are properly handled throughout the codebase. The changes update the API types, CRD schema, deep copy logic, and resource creation helpers to support this new field.API and CRD schema updates:
resources
field of typecorev1.ResourceRequirements
to theInitContainer
struct intestrun_types.go
, allowing users to specify resource requests and limits for init containers.k6.io_testruns.yaml
to include theresources
field for init containers, with full support forclaims
,limits
, andrequests
subfields. This ensures validation and schema generation for the new field. [1] [2] [3]Implementation updates:
DeepCopyInto
method forInitContainer
to properly deep copy the newResources
field, ensuring correct behavior during object duplication.jobs/helpers.go
to set theResources
field on generated Kubernetes containers based on the value from the init container spec.Issue: #655