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

feat: allow actions in a ComponentDefinition to have different image/container #7989

Closed
wants to merge 38 commits into from

Conversation

Ursasi
Copy link
Contributor

@Ursasi Ursasi commented Aug 16, 2024

Modified the code of kbagent for individual containers, supporting launching corresponding containers for each action.

@github-actions github-actions bot added the size/L Denotes a PR that changes 100-499 lines. label Aug 16, 2024
Copy link

codecov bot commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 47.24409% with 67 lines in your changes missing coverage. Please review.

Project coverage is 62.44%. Comparing base (9f5742c) to head (6644c0a).

Files Patch % Lines
pkg/controller/component/kbagent.go 47.24% 64 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7989      +/-   ##
==========================================
- Coverage   62.47%   62.44%   -0.03%     
==========================================
  Files         327      327              
  Lines       40267    40324      +57     
==========================================
+ Hits        25155    25182      +27     
- Misses      12841    12891      +50     
+ Partials     2271     2251      -20     
Flag Coverage Δ
unittests 62.44% <47.24%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

image = action.Exec.Image
image := action.Exec.Image
containerName := action.Exec.Container
if len(image) == 0 && len(containerName) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

should update comments of Exec.Image and Exec.Container (api-doc) to reflect their new semantics.

return err
}
if len(containers) == 0 {
containers = append(containers, container)
Copy link
Contributor

@weicao weicao Aug 20, 2024

Choose a reason for hiding this comment

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

This will affect the container’s name.

I want all actions that do not specify Exec.image or Exec.container to run in the "kba" container (whose port is kbAgentDefaultPort). Actions that do specify Exec.image or Exec.container should run in the "kba-${actionName}" container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this mean that this writing only focuses on the situation where all Actions have not specified an image and container, ignoring the cases where some Actions do not specify an image and container?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean if any action does not specify image and container (or the container is the first container in the Pod), it should reside in the "default" kbagent container, as before.

Only actions that specify the image or the container should be placed in the newly created kba-${actionName} container.

That looks more reasonable to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it.

@weicao weicao changed the title feat: implement kbagent multiple images feat: allow actions in a ComponentDefinition to have different image/container Aug 20, 2024
@github-actions github-actions bot added size/XL Denotes a PR that changes 500-999 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Aug 27, 2024
@Ursasi Ursasi marked this pull request as draft August 27, 2024 02:41
@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines. and removed size/XL Denotes a PR that changes 500-999 lines. labels Aug 27, 2024
@Ursasi Ursasi closed this Nov 9, 2024
@github-actions github-actions bot added this to the Release 0.9.2 milestone Nov 9, 2024
@Ursasi
Copy link
Contributor Author

Ursasi commented Nov 9, 2024

This implementation confuses the definitions of the Container and Image fields, and does not clarify the meaning of specifying a container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants