Skip to content

Conversation

gcaldasnu
Copy link

@gcaldasnu gcaldasnu commented Sep 19, 2025

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:

  • Added a resources field of type corev1.ResourceRequirements to the InitContainer struct in testrun_types.go, allowing users to specify resource requests and limits for init containers.
  • Updated the CRD schema in k6.io_testruns.yaml to include the resources field for init containers, with full support for claims, limits, and requests subfields. This ensures validation and schema generation for the new field. [1] [2] [3]

Implementation updates:

  • Updated the DeepCopyInto method for InitContainer to properly deep copy the new Resources field, ensuring correct behavior during object duplication.
  • Modified the helper function in jobs/helpers.go to set the Resources field on generated Kubernetes containers based on the value from the init container spec.

Issue: #655

@gcaldasnu gcaldasnu requested a review from yorugac as a code owner September 19, 2025 17:52
@CLAassistant
Copy link

CLAassistant commented Sep 19, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@yorugac yorugac left a comment

Choose a reason for hiding this comment

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

@gcaldasnu, thanks for the PR!
Overall, the change looks OK to me, but could you please double-check that the output of the commands described in the contributing guide is included?

@gcaldasnu
Copy link
Author

gcaldasnu commented Sep 30, 2025

@yorugac All requirements checked

@gcaldasnu gcaldasnu requested a review from yorugac September 30, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants