-
Notifications
You must be signed in to change notification settings - Fork 175
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
Conversation
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
image = action.Exec.Image | ||
image := action.Exec.Image | ||
containerName := action.Exec.Container | ||
if len(image) == 0 && len(containerName) == 0 { |
There was a problem hiding this comment.
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.
pkg/controller/component/kbagent.go
Outdated
return err | ||
} | ||
if len(containers) == 0 { | ||
containers = append(containers, container) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
# Conflicts: # pkg/controller/component/kbagent.go # pkg/controller/component/lifecycle/kbagent.go
…-containers-for-kbagent
This implementation confuses the definitions of the Container and Image fields, and does not clarify the meaning of specifying a container. |
Modified the code of kbagent for individual containers, supporting launching corresponding containers for each action.