Added resources in InitContainers #652
Merged
+390
−0
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
InitContainerdefinitions 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:
resourcesfield of typecorev1.ResourceRequirementsto theInitContainerstruct intestrun_types.go, allowing users to specify resource requests and limits for init containers.k6.io_testruns.yamlto include theresourcesfield for init containers, with full support forclaims,limits, andrequestssubfields. This ensures validation and schema generation for the new field. [1] [2] [3]Implementation updates:
DeepCopyIntomethod forInitContainerto properly deep copy the newResourcesfield, ensuring correct behavior during object duplication.jobs/helpers.goto set theResourcesfield on generated Kubernetes containers based on the value from the init container spec.Issue: #655